Advertisement
TimothyPlaysRB

ROBLOX >13 FIX CODE NEW

Mar 15th, 2024
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.96 KB | None | 0 0
  1. const axios = require('axios'); // - Access to internet APIs, use "npm i axios" in Terminal if you don't have it installed already.
  2. const readline = require('readline');
  3.  
  4. const rl = readline.createInterface({
  5. input: process.stdin,
  6. output: process.stdout
  7. });
  8.  
  9. async function getCSRFToken(cookie) {
  10. return new Promise((resolve, reject) => {
  11. axios.request({
  12. url: "https://auth.roblox.com/v2/logout",
  13. method: "post", // - Sends a POST request to the Roblox Logout API. This is required to confirm the cookie.
  14. headers: {
  15. Cookie: ".ROBLOSECURITY=" + cookie // - Uses your .ROBLOSECURITY cookie to generate a verification link using the Roblox API
  16. }
  17. }).catch(function (error) {
  18. resolve(error.response.headers["x-csrf-token"])
  19. })
  20. })
  21. }
  22.  
  23. function promptForCookie() {
  24. return new Promise((resolve) => {
  25. rl.question('Input your cookie: ', (cookie) => {
  26. rl.close();
  27. resolve(cookie);
  28. });
  29. });
  30. }
  31.  
  32. async function fetchVerificationLink(cookie) {
  33. const url = 'https://apis.roblox.com/age-verification-service/v1/veriff-id-verification/start-verification'; // - Sends a request to the Veriff (Roblox's ID verification service) API to generate a new link
  34.  
  35. const headers = {
  36. accept: 'application/json, text/plain, /',
  37. 'accept-language': 'en-US,en;q=0.9',
  38. 'cache-control': 'no-cache',
  39. 'content-type': 'application/json;charset=UTF-8',
  40. pragma: 'no-cache',
  41. 'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Brave";v="114"',
  42. 'sec-ch-ua-mobile': '?0',
  43. 'sec-ch-ua-platform': '"Windows"',
  44. 'sec-fetch-dest': 'empty',
  45. 'sec-fetch-mode': 'cors',
  46. 'sec-fetch-site': 'same-site',
  47. 'sec-gpc': '1',
  48. 'x-csrf-token': await getCSRFToken(cookie),
  49. cookie: ".ROBLOSECURITY=" + cookie
  50. };
  51.  
  52. const body = {
  53. generateLink: true
  54. };
  55.  
  56. try {
  57. const response = await axios.post(url, body, { headers, withCredentials: true });
  58. const verificationLink = response.data.verificationLink;
  59. return verificationLink; // - Uses your .ROBLOSECURITY cookie to generate a verification link using the Roblox API. The cookie is only used in the Roblox API, not the script.
  60. } catch (error) {
  61. console.error('Error occurred while fetching verification link:', error);
  62. return null;
  63. }
  64. }
  65.  
  66. async function main() {
  67. try {
  68. const cookie = await promptForCookie();
  69. const verificationLink = await fetchVerificationLink(cookie);
  70.  
  71. if (verificationLink) {
  72. console.log('Verification Link:', verificationLink);
  73. }
  74. } catch (error) {
  75. console.error('An error occurred (possibly because you tried verifying but failed, re-try in 7 days):', error);
  76. }
  77. }
  78.  
  79. main(); // - Outputs the verification link if done correctly.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement