Music

Setting Up discord-player-youtubei for Your Discord Bot

To set up and use discord-player-youtubei for your Discord bot, follow the steps outlined in this guide. Please note that you must use a throwaway account that is 18+ years old, as there is a risk of the account being banned.

Running the Setup Locally

1. Installing Node.js

Before you begin, you need to have Node.js installed on your machine. Follow these steps:

  • Download Node.js from the official website: Download Node.js v18.20.3

  • Run the installer and follow the instructions to complete the installation.

2. Running the Command

After installing Node.js, open the command prompt on your local machine and execute the following command:

npm install discord-player
npm install discord-player-youtubei
npm install discord.js
npx --no discord-player-youtubei
  • Login Requirement: You will be prompted to log in to a Google account. Use a throwaway Google account that is 18+ years old. There is a risk that this account may be banned, so avoid using any personal accounts.

3. Copying the Login String

After logging in, the command will generate a long string containing the access token and other necessary details. The string will look like this:

access_token=reallylongtoken; scope=https://www.googleapis.com/auth/youtube https://www.googleapis.com/auth/youtube-paid-content; token_type=Bearer; expiry_date=2024-08-12T09:01:59.019Z
  • Important: Copy the entire login string, as you will need to paste it into your configuration file.

4. Configuration

Next, you'll need to update your configuration file with the following settings:

YouTubeKey: ""
  • Paste the Access Token: In your configuration, paste the copied access token string into the appropriate field.

Last updated