Skip to content

Setting up

Bloxxy edited this page Jan 23, 2023 · 1 revision

Firstly install the modules by running

npm install youtube-selfbot-api

To generate a selfbot, you need to call new on the module. You can use this as an example:

let selfbot_api = require("youtube-selfbot-api")

// browserPath is a path to the chrome/chromium browser
// The second argument (Object) is completely optional and all its values are optional
// The third argument (Array) is completely optional. The arguments are passed to chrome
// The fourth argument (Array) is completely optional. Its a array of extensions for chrome to use

let bot = new selfbot_api(browserPath, {
   headless: false, // If it should be a headless browser? Its still undetectable by google.

   // Where it should save the local data, cache and cookies.
   // If undefined then it will be a random folder in the temp folder of your computer
   userDataDir: "path/to/data",

   // Read more about supported proxy types at https://github.com/JijaProGamer/youtube-selfbot-api/wiki/Proxies
   proxy: "direct://",

  // If it should skip ads by itself. If false then you would have to use the API
  // to skip the ads
  autoSkipAds: true | false,

  // After how many miliseconds to error if page couldn't navigate sucessfully
  // Default is 30000, setting it to 0 makes it infinite 
  timeout: 30000,

  dont_mute_audio: false, // If it should not mute the audio by itself
  no_visuals: false, // If it should only render the video (And dont render the webpage)
}, [
  "--disable-gpu",
  "--mute-audio",
], [
  "/path/to/extension1/",
  "/path/to/extension2/",
])

See all the functions the selfbot hosts here: https://github.com/JijaProGamer/youtube-selfbot-api/wiki/selfbot-instance