#1
(This post was last modified: 08 August, 2020 - 10:22 PM by HiddenToolz. Edit Reason: GIvi ng my vps ip and auth system )
I can't fucking generate an account, always having the same error !
If someone have a fix
error: Invalid Form Body
Source of my main code :
Code:
 
console.clear();
const fs = require("fs");
const request = require("request");
const uuid = require('machine-uuid-sync')();

  /// COLORS
  const red =  "\u001b[31m"
  const green = "\u001b[32m"
  const yellow = "\u001b[33m"
  const blue = "\u001b[34m"
  const magenta = "\u001b[35m"
  const cyan = "\u001b[36m"
  const white = "\u001b[37m"
  //////


var generator_speed = 0;
var generator_invite_link = "";
var generator_username_file = false;
var appdatapath = process.env.APPDATA || (process.platform == 'darwin' ? process.env.HOME + '/Library/Preferences' : process.env.HOME + "/.local/share")
var api_register_url = "https://discord.com/api/v6/auth/register";
var api_experiment_url = "https://discord.com/api/v6/experiments";
Generator_speedPrompt()
function Generator_speedPrompt() 
{
  
  prompt(`${white}Please enter the generator speed ${red}[${white}From 0 to 2000 miliseconds${red}]${white}\n> `, function (input) 
  {

    if (!/^\d+$/.test(input)) 
    {
      console.clear();
      console.log(`${white}[${red}ERROR${white}] Generator Speed Can only be Numbers !`);
      Generator_speedPrompt();
      return;
    }

  generator_speed = input;
  Generator_invite_linkPrompt()
  })
}


function Generator_invite_linkPrompt() 

  prompt(`${white}Please enter a server Invite URL ${red}[${white}https://discord.gg/INVITEID ${red}[${white}OR${red}] ${white}INVITEID ${red}[${white}OR${red}] ${white}LEAVE VOID${red}]${white}\n> `, function (input) 
  {
    var baseurl = input
    if (baseurl.includes("/")) 
    {
      baseurl = baseurl.split("/").pop();
    }
    if (baseurl.length !== 6 && baseurl.length !== 0) 
    {
      console.clear();
      console.log(`${white}[${red}ERROR${white}] Invalid Server Invite ID`);
      Generator_invite_linkPrompt()
      return;
    }
  generator_invite_link = baseurl
  setInterval(Generate,generator_speed);
  })
}







function Generate() { 
  var user_agent = randomUserAgent()

  var experimantalHeader = getExprimentHeader(user_agent)

  request({url:api_experiment_url, headers:experimantalHeader }, function (error,response,body) {
  var registerPost = getRegisterPost(body.split("\"")[3]) 
  var registerHeader = getRegisterHeader(user_agent,body.split("\"")[3],response.headers['set-cookie'] );
  console.log(registerPost)
  sendRequest(registerPost,registerHeader)
  })
}


function getExprimentHeader(user_agent) {
  var header = {};
  header["Host"] = "discord.com"
  header["Accept"] = "*/*"
  header["Accept-Language"] = "en-US"
  header["Content-Type"] = "application/json"
  header["Referer"] = "https://discord.com/register"
  header["Origin"] = "https://discord.com"
  header["DNT"] = "1"
  header["Connection"] = "keep-alive"
  header["user-agent"] = user_agent
  return header;
}
function getRegisterPost(fingerprint,cookie){
  var postdata = {};
 // postdata["captcha_key"] = null
  postdata["consent"] = true 
 // postdata["date_of_birth"] = randomBirthDate();
 // postdata["email"] = randomEmail();
  postdata["fingerprint"] = fingerprint
//  postdata["gift_code_sku_id"] = null
//  if (generator_invite_link === "") {postdata["invite"] = null} else {postdata["invite"] = generator_invite_link}
//  postdata["password"] = randomString(9);
 postdata["username"]  = randomPseudo();
  return postdata;
}
function getRegisterHeader(user_agent, fingerprint,cookie){
  var header = {};
  header["cookie"] = cookie
  header["x-fingerprint"] = fingerprint
  header["accept"] = "*/*"
  header["accept-language"] = "en-US"
  header["content-type"] = "application/json"
  header["referer"] = "https://discord.com/register"
  header["origin"] = "https://discord.com"
  //header["authorization"] = undefined
  header["x-track"] =  "eyJvcyI6IldpbmRvd3MiLCJicm93c2VyIjoiQ2hyb21lIiwiZGV2aWNlIjoiIiwiYnJvd3Nlcl91c2VyX2FnZW50IjoiTW96aWxsYS81LjAgKFdpbmRvd3MgTlQgNi4xOyBXaW42NDsgeDY0KSBBcHBsZVdlYktpdC81MzcuMzYgKEtIVE1MLCBsaWtlIEdlY2tvKSBDaHJvbWUvODQuMC40MTQ3LjEwNSBTYWZhcmkvNTM3LjM2IEVkZy84NC4wLjUyMi41MiIsImJyb3dzZXJfdmVyc2lvbiI6Ijg0LjAuNDE0Ny4xMDUiLCJvc192ZXJzaW9uIjoiNyIsInJlZmVycmVyIjoiIiwicmVmZXJyaW5nX2RvbWFpbiI6IiIsInJlZmVycmVyX2N1cnJlbnQiOiIiLCJyZWZlcnJpbmdfZG9tYWluX2N1cnJlbnQiOiIiLCJyZWxlYXNlX2NoYW5uZWwiOiJzdGFibGUiLCJjbGllbnRfYnVpbGRfbnVtYmVyIjo2NDg3NiwiY2xpZW50X2V2ZW50X3NvdXJjZSI6bnVsbH0=" //randomXSuperProprieties(user_agent)
  header["user-agent"] = user_agent
  return header;
}
function sendRequest(postdata,header) {
request.post({url:api_register_url   ,    form:postdata    ,    headers: header}, function (error, response, body) {
  console.error('error:', error); // Print the error if one occurred
  console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
  console.log(response)
  console.log('body:', body); // Print the HTML for the Google homepage.
});

}



  function randomPseudo() {
      var names = ["Mega", "Eternal", "Slir", "Enio", "Cask", "Madik", "Aqua", "Mastok", "Prog", "xX", "000", "Enia", "Gal", "Xyz", "Aix", "Snov", "Shie", "use", "77", "119", "Guin", "Score", "Light", "Mousk", "Moska", "Gunny", "Gun", "Zomb", "Infin", "Ity", "Gnioks", "Smart", "LeBg", "Malabar", "Eterox", "Nig", "Stuv", "Gambi", "Nin", "Nazz", "Subzz", "SxModl", "Put", "Sus", "Anak", "Imath", "Scri", "Ymox", "Ablar", "Balan", "YT_", "Souc", "Namas", "Oul", "Kiger", "Fola", "Sakb", "Sepho", "Orap", "Espi", "Esped", "Xyns", "Kyo", "Yre", "Enor", "Ivik", "Quiz", "_Bruks", "Enol_", "Airp", "Pods", "Chai", "Bouc", "Tush", "Patz", "Fail", "Refl", "Shi", "Dem1", "LaRi", "Ekt", "Espr", "Oala", "Ekl", "Sept", "John", "Diff", "Tomb", "Eur", "Shne", "Toy", "Rmal", "Teko", "Iznir", "Rmir", "Inuy", "1Ya", "Tuko" , "Dirk0" , "Anuk" , "xENz","MaZir","BoofT","xSkrb","Fortn","baby0","Isomx","Brasko","Kris","Nigre","8080L","Hidro","Mar0ko","Fr3q","QuesT","islobr","NoxD","IsouY","paNox","dispox","Gringr","Balisx","557aN","Liquid","Ingrt","Sp0rt","Run0m","sleePx","Chee","0Bama","","","","","","","","","","","","","","","","","","","","","","",""]
      return names[Math.floor(Math.random() * names.length)] + names[Math.floor(Math.random() * names.length)];
  }

  function randomString(length) {
      var result = '';
      var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
      var charactersLength = characters.length;
      for (var i = 0; i < length; i++) {
          result += characters.charAt(Math.floor(Math.random() * charactersLength));
      }
      return result;
  }

function getAvatar() {
var avatars = ["https://i.ibb.co/7nNnNjM/001.jpg","https://i.ibb.co/r3Y7DK0/002.jpg","https://i.ibb.co/X8BDjxp/003.jpg","https://i.ibb.co/jDTXwTP/004.jpg","https://i.ibb.co/P9FsjMz/005.jpg","https://i.ibb.co/Ch5FV2k/006.jpg","https://i.ibb.co/RBLM3Wx/007.jpg","https://i.ibb.co/bzqKH4v/008.jpg","https://i.ibb.co/LZsp3kd/009.jpg","https://i.ibb.co/DzHWDwY/010.jpg","https://i.ibb.co/GRW30Ky/011.jpg","https://i.ibb.co/M7FM3Hb/012.jpg","https://i.ibb.co/t2PGbnp/013.jpg","https://i.ibb.co/RH47GX5/014.jpg","https://i.ibb.co/dfRXz1x/015.jpg","https://i.ibb.co/5GXD5Bp/016.jpg","https://i.ibb.co/MRycy6G/017.jpg","https://i.ibb.co/ygPbt1Y/018.jpg","https://i.ibb.co/tHChBFj/019.jpg","https://i.ibb.co/yyXWBc8/020.jpg","https://i.ibb.co/fYpzr63/021.jpg","https://i.ibb.co/CJbh37N/022.jpg","https://i.ibb.co/wgmvQSf/023.jpg","https://i.ibb.co/Tg5HgfC/024.jpg","https://i.ibb.co/GRfxsY7/025.jpg","https://i.ibb.co/X7mNXcP/026.jpg","https://i.ibb.co/8K6d3Sr/027.jpg","https://i.ibb.co/Y7z6Tr2/028.jpg","https://i.ibb.co/GMp1L77/029.jpg","https://i.ibb.co/cD6DFmn/030.jpg","https://i.ibb.co/7NgBWVM/031.jpg","https://i.ibb.co/48KRYpK/032.jpg","https://i.ibb.co/zNcSPPW/033.jpg","https://i.ibb.co/WcQ2kLN/034.jpg","https://i.ibb.co/Q9hDq6m/035.jpg","https://i.ibb.co/28Xb0x2/036.jpg","https://i.ibb.co/Qvx2qDM/037.jpg","https://i.ibb.co/SXt6bNf/038.jpg","https://i.ibb.co/8xfXjcY/039.jpg","https://i.ibb.co/qW0wQqX/040.jpg","https://i.ibb.co/KFSpSGg/041.jpg","https://i.ibb.co/tJcz3n1/042.jpg","https://i.ibb.co/vm74X3t/043.jpg","https://i.ibb.co/XtzxXdK/044.jpg","https://i.ibb.co/VV2PbLd/045.jpg","https://i.ibb.co/WPkxG3v/046.jpg","https://i.ibb.co/Jkc0c58/047.jpg","https://i.ibb.co/j30xs57/048.jpg","https://i.ibb.co/L6vwWtq/049.jpg","https://i.ibb.co/84Nb4n1/050.jpg","https://i.ibb.co/dWnsRtL/051.jpg","https://i.ibb.co/jkR5Y3r/052.jpg","https://i.ibb.co/PQxZmr5/053.jpg","https://i.ibb.co/MpBPfky/054.jpg","https://i.ibb.co/fFDrT2q/055.jpg","https://i.ibb.co/pdSmpcW/056.jpg","https://i.ibb.co/VMHzkjY/057.jpg","https://i.ibb.co/ZYK9rcS/058.jpg","https://i.ibb.co/Vt0Cwtc/059.jpg","https://i.ibb.co/Np90GzW/060.jpg","https://i.ibb.co/PZsQhZb/061.jpg","https://i.ibb.co/31r9gcy/062.jpg","https://i.ibb.co/6DXmTSw/063.jpg","https://i.ibb.co/D1Z0548/064.jpg","https://i.ibb.co/qdMTPxR/065.jpg","https://i.ibb.co/72hPhs3/066.jpg","https://i.ibb.co/4Vbb3WC/067.jpg","https://i.ibb.co/G2ck827/068.jpg","https://i.ibb.co/dBtMPVr/069.jpg","https://i.ibb.co/cgQB6jh/070.jpg","https://i.ibb.co/MfcfXyx/071.jpg","https://i.ibb.co/S0MN0m4/072.jpg","https://i.ibb.co/Jq9Dtk0/073.jpg","https://i.ibb.co/59HMcRM/074.jpg","https://i.ibb.co/Cs4jzzZ/075.jpg","https://i.ibb.co/swZv2mD/076.jpg","https://i.ibb.co/kcMJDpB/077.jpg","https://i.ibb.co/5ntnW6v/078.jpg","https://i.ibb.co/9H2pqwm/079.jpg","https://i.ibb.co/G5TR1mD/080.jpg","https://i.ibb.co/L5Gp88G/081.jpg","https://i.ibb.co/sJn6Y5g/082.jpg","https://i.ibb.co/J7hk41W/083.jpg","https://i.ibb.co/gJX0VHB/084.jpg","https://i.ibb.co/TvXL6Nd/085.jpg","https://i.ibb.co/LQ34YPS/086.jpg","https://i.ibb.co/VNCkP3M/087.jpg","https://i.ibb.co/sVrMGwk/088.jpg","https://i.ibb.co/dPWyxBC/089.jpg","https://i.ibb.co/vq6rjYy/090.jpg","https://i.ibb.co/6R4YkwV/091.jpg","https://i.ibb.co/JBQpdhd/092.jpg","https://i.ibb.co/513NCbB/093.jpg","https://i.ibb.co/ZSf496M/094.jpg","https://i.ibb.co/CbmbjrB/095.jpg","https://i.ibb.co/ZX6z5dd/096.jpg","https://i.ibb.co/3NTmSr1/097.jpg","https://i.ibb.co/fkwnPCz/098.jpg","https://i.ibb.co/7rpdrFC/099.jpg","https://i.ibb.co/Mgz13dG/100.jpg","https://i.ibb.co/M5Scrvn/101.jpg","https://i.ibb.co/PcvGvDG/102.jpg","https://i.ibb.co/R4RQ8cm/103.jpg","https://i.ibb.co/h9W0jQD/104.jpg","https://i.ibb.co/FYyhv1k/105.jpg","https://i.ibb.co/NxDcYH4/106.jpg","https://i.ibb.co/zGQRFHJ/107.jpg","https://i.ibb.co/FXYPXTL/108.jpg","https://i.ibb.co/FJgcLHL/109.jpg","https://i.ibb.co/M6JXrvD/110.jpg","https://i.ibb.co/DLpWcgc/111.jpg","https://i.ibb.co/qsgLyVG/112.jpg","https://i.ibb.co/LCVJp2f/113.jpg","https://i.ibb.co/jk0nNP9/114.jpg","https://i.ibb.co/thYjnDw/115.jpg","https://i.ibb.co/DRysBT9/116.jpg","https://i.ibb.co/Rc7y5DH/117.jpg","https://i.ibb.co/8sz6HNv/118.jpg","https://i.ibb.co/F6s5jBk/119.jpg","https://i.ibb.co/fpJdHbV/120.jpg","https://i.ibb.co/kGhHVx2/121.jpg","https://i.ibb.co/FYdR8t7/122.jpg","https://i.ibb.co/zGZ2TSm/123.jpg","https://i.ibb.co/yFwQNvg/124.jpg","https://i.ibb.co/sKwgd7x/125.jpg","https://i.ibb.co/PzyLxYt/126.jpg","https://i.ibb.co/WcJ3Hrd/127.jpg","https://i.ibb.co/h2XCCQ6/128.jpg","https://i.ibb.co/zrWry3Y/129.jpg","https://i.ibb.co/P18KHD4/130.jpg","https://i.ibb.co/jGpBXmC/131.jpg","https://i.ibb.co/r00rctS/132.jpg","https://i.ibb.co/3F1phLw/133.jpg","https://i.ibb.co/QmNPBx5/134.jpg","https://i.ibb.co/RzrTZPQ/135.jpg","https://i.ibb.co/HC0VRqD/136.jpg","https://i.ibb.co/VDDCQrW/137.jpg","https://i.ibb.co/nczdkhp/138.jpg","https://i.ibb.co/B38qd17/139.jpg","https://i.ibb.co/h7TpT47/140.jpg","https://i.ibb.co/qyS2mw9/141.jpg","https://i.ibb.co/1ntYL28/142.jpg","https://i.ibb.co/hMtnBJk/143.jpg","https://i.ibb.co/mHCsTrz/144.jpg","https://i.ibb.co/SKnspV5/145.jpg","https://i.ibb.co/rHr6Zdw/146.jpg","https://i.ibb.co/XZ0k34n/147.jpg","https://i.ibb.co/Cwxc2jB/148.jpg","https://i.ibb.co/3CB2T6z/149.jpg","https://i.ibb.co/BqRHrJB/150.jpg","https://i.ibb.co/qdWKwtm/151.jpg","https://i.ibb.co/CbbMgcs/152.jpg","https://i.ibb.co/SBZwTNr/153.jpg","https://i.ibb.co/SXdzk3X/154.jpg","https://i.ibb.co/3F7zWss/155.jpg","https://i.ibb.co/3SQtQBK/156.jpg","https://i.ibb.co/Wff2n3n/157.jpg","https://i.ibb.co/wNYRp0J/158.jpg","https://i.ibb.co/M7z1cp8/159.jpg","https://i.ibb.co/b214qfG/160.jpg","https://i.ibb.co/WB2Fpvv/161.jpg","https://i.ibb.co/fXWwkqR/162.jpg","https://i.ibb.co/KxQqHZH/163.jpg","https://i.ibb.co/YWkXQNG/164.jpg","https://i.ibb.co/yXgKsFq/165.jpg","https://i.ibb.co/MpKfd7m/166.jpg","https://i.ibb.co/PhMbG4X/167.jpg","https://i.ibb.co/Fzw0VsR/168.jpg","https://i.ibb.co/wSmjyqX/169.jpg","https://i.ibb.co/JHZL56z/170.jpg","https://i.ibb.co/FYX9yV9/171.jpg","https://i.ibb.co/sPyJzxn/172.jpg","https://i.ibb.co/16m1Pcb/173.jpg","https://i.ibb.co/jZf5z5t/174.jpg","https://i.ibb.co/Ht9C15v/175.jpg","https://i.ibb.co/557hp82/176.jpg","https://i.ibb.co/xh9vqSP/177.jpg","https://i.ibb.co/mhB1qW3/178.jpg","https://i.ibb.co/Ksk1zQT/179.jpg","https://i.ibb.co/cDHX3c9/180.jpg","https://i.ibb.co/WyzDLNm/181.jpg","https://i.ibb.co/jwPNN9r/182.jpg","https://i.ibb.co/dbHjstP/183.jpg","https://i.ibb.co/sH9GfQn/184.jpg","https://i.ibb.co/DkGzBQ1/185.jpg","https://i.ibb.co/M981LsW/186.jpg","https://i.ibb.co/WF1Sqmh/187.jpg","https://i.ibb.co/wrmxBYj/188.jpg","https://i.ibb.co/GWw8nZF/189.jpg","https://i.ibb.co/r5sLb7T/190.jpg","https://i.ibb.co/jJ6rgRb/191.jpg","https://i.ibb.co/86QNdGj/192.jpg","https://i.ibb.co/hHYkV4P/193.jpg","https://i.ibb.co/pbT1Q2t/194.jpg","https://i.ibb.co/rcFmkTX/195.jpg","https://i.ibb.co/nPBFk89/196.jpg","https://i.ibb.co/809c6zL/197.jpg","https://i.ibb.co/hH8Jwf2/198.jpg","https://i.ibb.co/mTzVnQk/199.jpg","https://i.ibb.co/WchMxvJ/200.jpg","https://i.ibb.co/b1f9yx3/201.jpg","https://i.ibb.co/hd5bhmH/202.jpg","https://i.ibb.co/6ZLrtjv/203.jpg","https://i.ibb.co/LYz5z6x/204.jpg","https://i.ibb.co/GRNnjxt/205.jpg","https://i.ibb.co/yq1nbTw/206.jpg","https://i.ibb.co/f878L33/207.jpg","https://i.ibb.co/5KRV15w/208.jpg"]
return avatars[Math.floor(Math.random() * avatars.length)] + avatars[Math.floor(Math.random() * avatars.length)];
}
  function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min + 1)) + min;
  }

  function randomEmail() {
  var emailPrefix = ["@gmail.com", "@hotmail.fr", "@hotmail.com", "@yahoo.fr", "@gmail.fr", "@laposte.fr", "@icloud.com"]
  return randomString(12) + emailPrefix[Math.floor(Math.random() * emailPrefix.length)];
  }

  function randomBirthDate() {
  return `${getRandomInt(1992,2001)}-0${getRandomInt(1,9)}-${getRandomInt(10,28)}`
  }

  function randomUserAgent() {
  var userAgents = ["Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36","Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36 Edge/14.14393","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)","Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0; en-US)","Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/5.0;  Trident/5.0)"]
  return userAgents[Math.floor(Math.random() * userAgents.length)] + userAgents[Math.floor(Math.random() * userAgents.length)];
  }



function randomXSuperProprieties(useragent) {
return Buffer.from(`{"os": "Windows","browser": "Chrome","device": "","browser_user_agent": "${useragent}","browser_version": "84.0.4147.105","os_version": "7","referrer": "","referring_domain": "","referrer_current": "","referring_domain_current": "","release_channel": "stable","client_build_number": "64675","client_event_source": null}`, 'utf8').toString('base64');
}


function prompt(question, callback) {var stdin = process.stdin,stdout = process.stdout;stdin.resume();stdout.write(question);stdin.once('data', function (data) {callback(data.toString().trim());});}