[
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2022 I2rys\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# opengen-bot\nGenerate Netflix, Spotify, NordVPN & Disney+ accounts.\n\n## Installation\nGithub:\n```\ngit clone https://github.com/I2rys/opengen-bot\n```\n\nNpmJS:\n```\nnpm i axios fs\n```\n\n## Usage\n```\nnode index.js <accountType> <amount> <outputFile>\n```\n+ accountType - The type of the account to generate.\n+ amount - The amount of accounts to generate.\n+ outputFile - The output file of the generated accounts.\n\n## License\nMIT © I2rys"
  },
  {
    "path": "index.js",
    "content": "\"use strict\";\n\n// Dependencies\nconst axios = require(\"axios\")\nconst fs = require(\"fs\")\n\n// Variables\nconst args = process.argv.slice(2)\n\nvar openGenBot = {\n    grabIndex: 0,\n    max: 0,\n    results: []\n}\n\n// Functions\nasync function grab(accountType){\n    try{\n        if(openGenBot.grabIndex === openGenBot.max){\n            console.log(`Finished grabbing ${openGenBot.max} ${accountType} accounts.`)\n            console.log(`Saving the results to ${args[2]}`)\n            fs.writeFileSync(args[2], openGenBot.results.join(\"\\n\"), \"utf8\")\n            return console.log(`Results successfully saved to ${args[2]}`)\n        }\n    \n        console.log(`Grabbing ${accountType} accounts. Index: ${openGenBot.grabIndex}`)\n    \n        var response = await axios(`https://opengen.dpkghub.com/api/generate.php?type=${accountType}`)\n        response = response.data\n    \n        if(openGenBot.results.includes(response)){\n            console.log(`Unable to grab ${accountType} account, due to duplicate/error. Index: ${openGenBot.grabIndex}`)\n            console.log(\"Retrying...\")\n            return grab(accountType)\n        }\n    \n        openGenBot.results.push(response)\n    \n        openGenBot.grabIndex++\n        grab(accountType)\n    }catch{\n        console.log(`Unable to grab ${accountType} account, due to duplicate/error. Index: ${openGenBot.grabIndex}`)\n        console.log(\"Retrying... Please wait for 2 seconds.\")\n\n        setTimeout(()=>{\n            grab(accountType)\n        }, 2000)\n    }\n}\n\n//Main\nif(!args.length) return console.log(`Account Types: Netflix, Spotify, NordVPN & Disney(Disney plus).\nnode index.js <accountType> <amount> <output>`)\n\nif(isNaN(args[1])) return console.log(\"amount is not a number.\")\nif(!args[2]) return console.log(\"Invalid output.\")\n\nargs[0] = args[0].toLowerCase()\nopenGenBot.max = parseInt(args[1])\n\nswitch(args[0]){\n    case \"netflix\":\n        grab(\"Netflix\")\n        break\n    case \"spotify\":\n        grab(\"Spotify\")\n        break\n    case \"nordvpn\":\n        grab(\"NordVPN\")\n        break\n    case \"disney\":\n        grab(\"Disney\")\n        break\n    default:\n        console.log(\"Invalid accountType.\")\n        break\n}"
  }
]