Skip to content

Commit

Permalink
update readme and docker-compose.yml for self-hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
vaaski committed Mar 26, 2024
1 parent 1f11edf commit a89d635
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 5 deletions.
36 changes: 34 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,38 @@ format that contains both video and audio. This is meant to work together with a
Telegram bot API server, so that the upload limit for bots is increased from 50MB to 2GB.

The instance hosted by me is no longer available for public use, but you can simply host your own instance.
Instructions are coming soon™.

[yt-dlp]: https://github.com/yt-dlp/yt-dlp
## Hosting

To host your own instance of this bot, you need to have a Telegram bot token, Telegram API Token
and a server to run the bot on. You can create a Telegram bot with [BotFather][botfather] and purchase
a cheap VPS with the hoster of your choice.

I recommend [Hetzner][hetzner] and you can get 20€ in credits for free using my [referral link](hetzner).

### Installation

- [Install Docker](https://docs.docker.com/engine/install)
- Create a folder and put the [docker-compose.yml](./docker-compose.yml) into it.
- Fill out and adjust the following variables in the docker-compose.yml file:

| Variable | Description |
| ----------------------- | -------------------------------------------------------------------------------------------------------------- |
| `TELEGRAM_BOT_TOKEN` | Your Telegram bot token (get it from [BotFather][botfather]) |
| `WHITELISTED_IDS` | A comma-separated list of Telegram user IDs that are allowed to use the bot (get them from [this bot][id-bot]) |
| `ADMIN_ID` | Your Telegram user ID (get it from [this bot][id-bot]) |
| `TELEGRAM_API_ID` | Your Telegram API ID (get it [here][telegram-api-id]) |
| `TELEGRAM_API_HASH` | Your Telegram API hash (get it [here][telegram-api-id]) |
| `TELEGRAM_API_ROOT` | The URL of your Telegram bot API server (can probably be left unchanged) |
| `TELEGRAM_WEBHOOK_PORT` | The port the bot will listen on (can probably be left unchanged) |
| `TELEGRAM_WEBHOOK_URL` | The URL of your Telegram bot API server (can probably be left unchanged) |

- Run `docker compose up -d` in the folder you created.

If you have any problems with hosting please don't open an Issue, but rather contact me directly.

[yt-dlp]: https://github.com/yt-dlp/yt-dlp
[telegram-api-id]: https://core.telegram.org/api/obtaining_api_id
[id-bot]: https://t.me/getidsbot
[botfather]: https://t.me/BotFather
[hetzner]: https://hetzner.cloud/?ref=e5ntAQJVvxX1
26 changes: 23 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
version: "3.9"

services:
app:
image: telegram-ytdl
telegram-bot:
image: ghcr.io/vaaski/telegram-ytdl:latest
network_mode: host
restart: unless-stopped
environment:
# get your bot token from @BotFather
TELEGRAM_BOT_TOKEN: ""
Expand All @@ -17,5 +19,23 @@ services:
TELEGRAM_WEBHOOK_PORT: "8443"
TELEGRAM_WEBHOOK_URL: "http://127.0.0.1:8443"

telegram-bot-api:
image: ghcr.io/bots-house/docker-telegram-bot-api:latest
network_mode: host
restart: unless-stopped
restart: unless-stopped
environment:
# get these values from https://core.telegram.org/api/obtaining_api_id
TELEGRAM_API_ID: ""
TELEGRAM_API_HASH: ""
command:
- --dir=/var/lib/telegram-bot-api
#- --verbosity=2
- --local
volumes:
- server-data:/var/lib/telegram-bot-api
ports:
- 8081:8081

volumes:
server-data:
driver: local

0 comments on commit a89d635

Please sign in to comment.