This Telegram bot allows you to turn YouTube videos into podcast feed that you can listen to in your favorite podcast app. Simply send a YouTube link to the bot and it will download the video, extract the audio, and generate an RSS feed that you can host on your server or use S3 storage.
The bot is built using Bun
and uses the youtube-dl-exec library to download and extract the audio from the YouTube videos. It also uses the podcast library to generate the RSS feed.
To use the bot, you'll need to set up a Telegram bot and get an API token. You'll also need to have Bun
and Node.js
installed.
-
Clone this repository:
git clone https://github.com/uqe/youtube2rss
-
Install dependencies:
bun install
-
Create SQLite database:
bun run prepare
-
Create the
.env
or.env.dev
file with your Telegram bot token and Server URL (both are required) like in the.env.example
file. -
Start a Teleram bot (production):
bun run start
or in development mode:
bun run start:dev
-
Start a chat with your bot in Telegram.
-
Send the bot a YouTube link.
-
The bot will download the video, extract the audio, and generate an RSS feed.
-
Host the RSS feed on your server and subscribe to it in your favorite podcast app.
-
Start the static file server (production):
bun run serve
or development mode:
bun run serve:dev
- Fill env variables:
TELEGRAM_BOT_TOKEN
,SERVER_URL
,S3_BUCKET
,S3_ACCESS_KEY
,S3_ENDPOINT
andS3_SECRET_KEY
in the.env
or.env.dev
file.
If all variables are set, the bot will store .mp3
files and generated rss.xml
file in your S3 bucket. I'm using Cloudflare R2 as S3 compatible storage. The free plan is sufficient for my needs.
This project is licensed under the MIT License. See the LICENSE file for details.
- Update README
- Add pm2
- Better logging
- Add thumbnails podcast episodes
- Parse timestamps in video description and add them to the podcast feed