A Slack bot that reads YouTube links posted in a channel and adds them to a YouTube playlist.
This is an updated version adapted from YouSlackBot.
Create a Fly app and set the app name in fly.toml
.
Create a Slack bot and store the token as the SLACK_TOKEN
secret:
flyctl secrets set "SLACK_TOKEN=xoxb-12345..."
Create a Google project and add the YouTube Data API v3.
Create an OAuth consent screen. If you want others outside your organisation to use it, you'll need to publish the app.
Create an OAuth client ID (Web application type) and set the redirect URI to https://your-slack-app.fly.dev.
Download the credentials and set them as the YOUTUBE_CREDENTIALS
secret:
flyctl secrets set "YOUTUBE_CREDENTIALS=$(< credentials.json)"
Store the YouTube playlist ID as the YOUTUBE_PLAYLIST
secret:
flyctl secrets set "YOUTUBE_PLAYLIST=..."
Deploy the app with flyctl deploy
and visit https://your-slack-app.fly.dev to authorise the app with Google.
You can then invite the Slack bot to any channels.