Watch later on YouTube Telegram Bot: @YouTubeWatchLaterBot.
Send YouTube links to this bot to add them to your "Watch later" playlist.
You can host YWLTB yourself for free on Heroku using the button at the top of this README if you don’t trust me. Although, you’ll need to configure a few things.
As is is a Telegram bot, you’ll need to configure your own bot.
Just go to the @BotFather, run the /newbot
command and follow the instructions.
Note the bot API token after the bot is created: you’ll need to pass it via TELEGRAM_BOT_TOKEN
environment variable to the app.
The template includes a free tier setup of Heroku Postgres, it should be sufficient for a personal use.
Everything should be configured automatically, and the DATABASE_URL
environment variable should be populated.
The most interesting part!
I recommend creating a separate project in Google Cloud Platform for YWLTB.
After the project is selected, go to "APIs & Services" → "Credentials":
Click on "+ CREATE CREDENTIALS" and select "OAuth client ID":
Fill up the details like on the image below.
Use you own Authorized redirect URIs! Redirect URI is basically your Heroku’s app URL + /authorize
.
E.g. if you prefer to name your app like my-ywltb
(names must be unique, I guess), then the URI should be https://my-ywltb.herokuapp.com/authorize
.
BTW, this URL should be set in GOOGLE_REDIRECT_URL
environment variable.
Note the Client ID and Client secret, you’ll need to put them into GOOGLE_CLIENT_ID
and GOOGLE_CLIENT_SECRET
environment variables of your Heroku app.
Go to "OAuth consent screen" page under "APIs & Services" section and fill the form.
You may use any values here, especially if you choose not to publish your app.
The most important config os "Scopes for Google APIs": don’t forget to add https://www.googleapis.com/auth/youtube
scope (scopes are basically strings).
This scope is required to manage your YouTube content, and, more specifically, to add videos to "Watch Later" playlist.
That’s all you need to do in Google Cloud Console.
While using the original app (@YouTubeWatchLaterBot / https://ywltb.herokuapp.com) or your own self-hosted installation you may see a screen like this:
It’s totally okay and means that the app was not verified by Google employees yet. I hope one day they will approve the original app, and the screen will go. It’s okay to make your app "Internal" on Google Cloud Platform as well and use it solely by yourself.
It’s okay, the app is probably just being woken up after a power nap.
If it doesn’t respond in 30-45 seconds, take a look at the logs in Heroku UI or CLI (heroku logs
).