- A lightweight Twitch chat bot application.
- Integrates YouTube link requests from the Twitch chat stream to the desired YouTube playlist.
- Output YouTube links to a file to allow for additional cross-referencing and verification of Twitch chat stream requests.
Allow for reaction-based Twitch streamers to streamline YouTube requests to his/ her playlist. The playlist may then be used for shared viewing within his/ her Twitch community or used for personal leisure.
- Node JS/ Javascript
- Google Cloud Platform
- Google Cloud Platform account
- Twitch account
- YouTube account
- Register and log into Twitch developer console.
- Select the Applications tab, and click + Register Your Application.
- Enter desired app name and http://localhost as the OAuth redirect URL. Then select Chat Bot as the app category.
- Click Create, and the app is created and listed on the dashboard as a registered app.
- Click Manage to see the client ID.
- Connect to Twitch Chat Password Generator to authorize access to desired Twitch account.
- Copy the generated OAuth login password, and paste it to replace value for
OAUTH_TOKEN
in /const.js. Also replace value for CHANNEL_NAME with desired Twitch channel alias.
Get and integrate your YouTube OAuth token to call YouTube API & setup necessary scopes for the OAuth consent.
- Log into Google Developers Console and create a new project.
- Open the Credentials page in the API & Services console and create an OAuth client ID with Desktop app as the Application type, and enter desired Desktop client name.
- Click Create, and the OAuth client is created with the associated Client ID and Client Secret values.
- Download the associated JSON file for the OAuth client to the project's working directory; preferably under a new /resources folder as client_secret.json.
- Open the OAuth consent screen in the API & Services console and select External as the User Type, then click Create.
- Provide the desired Application name, then click Save to persist the new OAuth consent for editing later.
- Open the Library page in the API & Services console and search for 'YouTube', and click on the search result YouTube Data API v3.
- Activate the YouTube API by clicking Enable, and verify the API details in the loaded Overview page.
- Click on the Navigation menu and go back to APIs & Services console -> OAuth consent screen.
- Edit App to go to the OAuth consent screen details.
- Under Scopes for Google APIs, click Add scope and check the following scopes:
- ../auth/youtube.force-ssl
- ../auth/youtubepartner
- ../auth/youtube
- Click Add, and then click Save to persist the scopes to the current Oauth consent.
- Run the application with 'npm start' command with a supported console.
- Follow the commands to authorize the app by visiting the loaded Google Cloud account URL.
- Follow the instructions, and then copy-and-paste the generated code back into the command prompt.
- Overwrite the
playlistId
in the /quickstart.js::addToPlaylist
with YouTube playlist under your account; retrieve playlistId from the URL. - Initiate Twitch chat stream associated with Twitch OAuth token setup.
- Run the application with 'npm start'.
- Verify Twitch and Youtube connection in console, and bot message initiated in Twitch chat.
command 'npm start' will fire up the bot; console logging reveals connection status to Twitch chat stream and YouTube Data API; a welcome message from the bot will be sent to the Twitch chat box.
- Send YouTube links to the Twitch chat box.
- Verify console logging of each YouTube link; invalid links will not be logged.
request YouTube links to the Twitch chat stream; console logging reveals each valid YouTube link in the format @user - videoID.
- Verify /output/youtube.list for additional info of each YouTube link request.
- Verify items added to the YouTube playlist associated with account and playlistId.
youtube.list output will display each valid YouTube link in the format @user - youtubeURL; each YouTube link will be listed as a playlist item under the corresponding YouTube playlist.