Files
uptodownbot/README.md
db123 05fcdf7458 feat: initial implementation of uptodownbot
Telegram bot for downloading media from any site using yt-dlp.
Supports audio/video/both, quality selection, language picker,
container format selection, playlist pagination, progress updates,
per-user quotas, user preferences, download history, cancel at any step,
polling and webhook modes, proxy support, and SQLite persistence.
2026-06-25 14:22:48 +03:30

82 lines
2.5 KiB
Markdown

# uptodownbot
Telegram bot for downloading media from supported sites using yt-dlp.
## Features
- Download audio, video, or combined audio+video from any site yt-dlp supports
- Multi-step format selection: media type, quality, language, container
- Playlist support with paginated entry selection (10 per page)
- Download progress updates (every 5%)
- Cancel downloads at any time
- Per-user quota system (daily, weekly, monthly)
- User preferences (default quality, container, language)
- Download history
- Configurable file size limit
- Cookies support for age-restricted content
- Proxy support via HTTP_PROXY/HTTPS_PROXY env vars
- Webhook and polling modes
- SQLite database for persistence
## Commands
- `/start` - Show main menu
- `/settings` - Open settings
- `/help` - Show help text
- `/history` - View download history
Just send a URL to start downloading.
## Configuration
Copy `.env.example` to `.env` and configure:
| Variable | Default | Description |
| ------------------- | ------------------ | -------------------------------- |
| `BOT_TOKEN` | (required) | Telegram Bot API token |
| `HTTP_PROXY` | empty | Outbound HTTP proxy |
| `HTTPS_PROXY` | empty | Outbound HTTPS proxy |
| `DB_PATH` | `data/uptodown.db` | SQLite database path |
| `DOWNLOAD_DIR` | `/tmp/uptodown` | Temporary download directory |
| `MAX_FILE_SIZE_MB` | `2000` | Maximum upload file size in MB |
| `COOKIES_FILE` | empty | Path to cookies.txt for auth |
| `TZ` | `UTC` | Timezone |
| `BOT_ALLOWED_USERS` | empty | Comma-separated allowed user IDs |
| `BOT_WEBHOOK_URL` | empty | Webhook URL (omit for polling) |
| `BOT_LISTEN` | `:8080` | Webhook listen address |
| `BOT_TLS_CERT` | empty | TLS certificate path |
| `BOT_TLS_KEY` | empty | TLS key path |
## Running
### Polling mode (default)
```bash
cp .env.example .env
# edit .env with your BOT_TOKEN
make run-dev
```
### Webhook mode
```bash
export BOT_WEBHOOK_URL=https://your.domain.com/webhook
make run-dev
```
### Docker
```bash
make docker-run
```
## Development
```bash
make build # build binary
make test # run tests
make fmt # format code
make vet # vet code
make check # fmt + vet
```