feat: add auto-select from preferences and type picker
All checks were successful
CI / build (push) Successful in 52s

- Add MediaTypeAsk (0) as the default, mapping old video_audio to Ask
- Show Video/Audio/Ask type picker when no default media type is set
- Auto-select matching format and skip picker when defaults are configured
- Add autoSelectVideoFormat / autoSelectAudioFormat helpers with closest-match
- Add buildFilteredFormatList for type-filtered format lists
- Add Media Type setting in settings UI (Ask/Video/Audio)
- Add --merge-output-format mp4 for video downloads via yt-dlp
- Fix formatLabelForDisplay to show Height fallback and Extension
- Add cookies volume mount to docker-compose.yml
- Document cookies setup and new features in README
This commit is contained in:
2026-06-28 11:28:53 +03:30
parent 6bbc87a7c8
commit b11b5649a5
12 changed files with 578 additions and 18 deletions

View File

@@ -9,14 +9,15 @@ Telegram bot for downloading media from any site yt-dlp supports.
- DRM fallback: automatically searches YouTube when Spotify/DRM-protected content is detected
- Thumbnail preview with metadata (title, uploader, duration) before download
- Audio-only sites (Spotify, SoundCloud, YouTube Music, etc.) auto-detect and skip to audio quality selection
- Multi-step format selection: quality, secondary format (audio/video combine), language
- Multi-step format selection: type picker (Video/Audio/Ask), quality, secondary format (video+audio combine), language
- Auto-select: skip the format picker entirely when defaults are set in user preferences
- Download progress updates (with speed and ETA)
- Cancel downloads at any time (terminates yt-dlp process)
- Per-user quota system (daily, weekly, monthly; 0 = unlimited)
- User preferences (default audio/video quality, language)
- User preferences (default media type, audio/video quality, language)
- Download history with pagination
- Configurable file size limit (default 50 MB)
- Cookies support for age-restricted content
- Cookies support for age-restricted and authenticated content
- Proxy support via HTTP_PROXY/HTTPS_PROXY env vars
- Webhook and polling modes
- SQLite database for persistence
@@ -52,6 +53,17 @@ Copy `.env.example` to `.env` and configure:
| `BOT_TLS_CERT` | empty | TLS certificate path |
| `BOT_TLS_KEY` | empty | TLS key path |
### Cookies (for age-restricted and authenticated content)
Some sites (YouTube, Spotify, etc.) require cookies for age-restricted content. To set up:
1. Install a browser extension that exports cookies in Netscape format (e.g., "Get cookies.txt" for Chrome/Firefox).
2. Log into the site with a throwaway account.
3. Export cookies to a file named `cookies.txt` in the project root.
4. Set `COOKIES_FILE=/cookies.txt` in your `.env` file.
For Docker, the cookie file is automatically mounted from `./cookies.txt` (see `docker-compose.yml`).
## Running
### Polling mode (default)