Commit graph

66 commits

Author SHA1 Message Date
vrubelroman
5092d882e5 feat(bot): proactive cookie health-check + simpler user-facing errors
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 51s
Add /cookies/check to youtube-downloader and instagram-downloader,
polled every 30 min from bot.py; alerts the admin bot on
healthy->broken transitions (with a 24h re-reminder cap while still
broken) and on recovery. Also stop leaking raw exception text to end
users - they now see a plain, friendly English message while the
admin bot still gets full technical detail via notify_admin_error.
2026-07-25 22:30:49 +00:00
vrubelroman
be1acaaf2b feat(bot): forward download errors to admin bot
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 51s
Notify admin (URL + error text + user info) on any download failure
across all sources, and on the file-too-large case, mirroring the
existing successful-download notification.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-21 18:16:42 +00:00
vrubelroman
72ba00bdcd fix(youtube): retry without cookies on any yt-dlp failure, not just cookie-worded errors
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 50s
YouTube's SABR-only streaming rollout produces errors like "Signature
solving failed" / "Requested format is not available" that don't
mention cookies, so the existing no-cookies fallback never triggered.
Cookies also disable the android client, which is often the only one
still returning usable formats under this restriction.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-08 10:55:06 +00:00
vrubelroman
d5201df802 fix(stats): count link_count per Telegram user, not per chat
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 2m11s
chat_id is shared by every member of a group chat, so all group
messages incremented one shared row and username kept getting
overwritten by whoever sent last. Track link counts in a new
user_links table keyed by the real from_user.id instead.
2026-07-03 14:29:35 +00:00
vrubelroman
87ef82ef7f fix(admin_bot): align /stat output and expand top list to 10
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 2m6s
Per-line strip() only stripped the first line's leading spaces, leaving
subsequent lines indented differently. RTL names (Arabic etc.) also
flipped the number/counter to the right via Telegram's bidi handling.
2026-07-03 13:48:28 +00:00
vrubelroman
d9ff2aec57 feat(admin_bot): show link-senders count and top-5 active users in /stat
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m43s
Adds users.link_count, incremented in bot.py whenever a user submits
a recognized link (regardless of eventual download success), and
surfaces it in admin_bot's /stat as a count of users who ever sent a
link plus a top-5 leaderboard by link count.
2026-06-30 22:28:53 +00:00
vrubelroman
772e9fd5b4 chore: remove obsolete per-folder scripts, add cookies-cron reference, update docs
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
- Remove get_cookies.sh (targets a container without yt-dlp, already
  broken), get_cookies_local.sh, start_all.sh/stop_all.sh — these
  implement the old per-service-compose startup that now conflicts
  with the unified root docker-compose.yml.
- Add cookies-cron/ — a reference copy of the scripts actually running
  via cron on the separate browser-equipped machine, with setup
  requirements and instructions for standing up a new cron host.
- Update README.md/ARCHITECTURE.md to describe the current unified
  docker-compose + CI/CD deploy flow and host-mounted cookies instead
  of the old per-folder workflow.
2026-06-30 22:16:40 +00:00
vrubelroman
b3550f4aaf fix(cookies): mount youtube/instagram cookies from host instead of baking into image
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m45s
Cookies baked into the image (COPY . .) required a full CI/CD rebuild
to refresh, incompatible with the cron job on the fedora machine that
re-extracts cookies from a logged-in browser every 20 minutes and
scp's them to prod. Volume-mount the cookies file instead — yt-dlp
reads it from disk per request, so a fresh scp takes effect
immediately with no container restart. The image-baked copy still
exists as a build-time fallback.

Also refresh the committed cookies snapshot (the cron's source yt-dlp
turned out to be missing on the fedora box, so prior commits had been
carrying years-stale cookies without anyone noticing).
2026-06-30 22:02:14 +00:00
vrubelroman
6df47f3082 feat(admin_bot): prepend service-message header to broadcasts
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m50s
2026-06-30 20:48:57 +00:00
vrubelroman
3ffdbbcdaf feat(admin_bot): add /send_messages broadcast command
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m47s
Admin sends /send_messages, the next text message is broadcast to
every user in the users table. Sends via TELEGRAM_BOT_TOKEN (the
client bot), not the admin bot's own token — broadcasting through
context.bot would land in the user's chat with the admin bot, which
they've never opened, instead of the client bot they actually use.
2026-06-30 20:46:11 +00:00
vrubelroman
ac2bd8f644 fix(bot): retry admin video upload on transient httpx transport errors
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m44s
send_video_to_admin_bot() had no retry, unlike the client-facing
reply_video() path fixed earlier — a transient httpx.ReadError during
upload silently dropped the admin copy while the user still got their
video, since this function swallows its own exceptions.
2026-06-30 20:31:37 +00:00
vrubelroman
67dba21ff9 fix(youtube): correct extractor-args separator, soften worker recycling, retry video upload
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 1m53s
EXTRACTOR_ARGS used ':' instead of ';' between player_client and skip
fields, so yt-dlp parsed "android:skip=translated_subs" and "hls" as
bogus player_client values and silently fell back to the web client
only, which fails the n-challenge and returns no formats.

--max-requests=1 fully restarted the gunicorn worker after every
single request, opening a race window that could drop the response
connection right after a successful download; raised to 20 with
jitter to keep the periodic-recycle safety net without doing it on
every request.

reply_video() to Telegram had no retry, so a transient httpx
transport error during upload discarded an already-downloaded video;
added the same 3-attempt retry pattern already used for the
downloader services.
2026-06-30 20:24:46 +00:00
vrubelroman
ab703e4bd6 ci: add Forgejo Actions CI/CD pipeline for build, push and prod deploy
All checks were successful
CI/CD Pipeline / build-and-deploy (push) Successful in 7m3s
Mirrors the LichessStatTgWeb pipeline: build all 7 service images,
push to the Gitea registry, transfer to the prod host via docker
save/load (registry isn't reachable from the external VPS), and
redeploy with docker-compose.prod.yml.
2026-06-30 19:44:05 +00:00
vrubelroman
4d575059b0 fix(youtube-downloader): subprocess yt-dlp CLI — bypass _ssl handshake timeout 2026-06-08 16:17:02 +00:00
vrubelroman
ce6505c9bb chore: remove youtube quality selection ui 2026-06-04 21:32:13 +00:00
vrubelroman
c4d4a77229 fix(downloader): chain fallback aria2c-curl-native + timeouts 2026-06-04 21:30:37 +00:00
vrubelroman
a9d1ffc864 fix: prevent VK downloader from blocking queue 2026-05-25 16:46:35 +00:00
vrubelroman
5d3cd92a03 fix: add vk.ru domain support for VK videos 2026-05-09 16:58:12 +03:00
vrubelroman
60a0373d7f fix: remove client-side format cache, prefer first audio track over largest 2026-05-03 17:43:24 +03:00
vrubelroman
e2ead9db52 tweak: simplify auto-download text 2026-05-03 03:27:21 +03:00
vrubelroman
c1d8a8235d fix: prefer Russian audio track, add FFmpegFixupStretched, remove broken h264_metadata bsf 2026-05-03 03:22:26 +03:00
vrubelroman
59b1c54668 fix: allow_unplayable_formats removed, reply_video, auto-select 480p, remove file sizes 2026-05-03 02:39:27 +03:00
vrubelroman
839cd57f6f fix: audio-only format, m4a/mp3 support, source URL in caption 2026-05-03 01:56:31 +03:00
vrubelroman
053f6c8afc fix: correct quality selection -- specific format_id first, exclude av01, validate video stream 2026-05-03 01:36:04 +03:00
vrubel
326eabaa99 Fix YouTube 500 error (n-challenge) and Telegram callback_data overflow 2026-04-30 17:21:10 +03:00
vrubelroman
4629535e97 fix: отправка видео как документ (без сжатия Telegram) и исправление format_id для точного выбора качества
- Замена reply_video() на reply_document() в bot.py — Telegram больше не сжимает видео
- Исправление format_id в get_youtube_formats(): конкретные format codes + fallback best[height<=N]
- Замена bestvideo[height<=N]+bestaudio на best[height<=N] — гарантированно работает когда
  YouTube не отдаёт отдельные video-only потоки для низких разрешений
- Добавлено логирование реально скачанного формата для диагностики
2026-04-30 01:36:43 +03:00
vrubelroman
4b7cc403b2 Implement file deletion after successful video sending in bot.py and update YouTube cookies for improved session management. 2026-01-10 22:26:18 +00:00
vrubelroman
551b64777a Update admin bot token, refine VK and Yapfiles URL handling, enhance Docker configuration for Instagram downloader, and improve YouTube downloader's cookie validation and error messaging. 2026-01-10 21:40:07 +00:00
vrubel
5c8456de96 Update .env.example with new admin bot token, modify Docker configuration for Instagram downloader to use host network mode, and enhance YouTube downloader with improved cookie validation and error handling for video downloads. 2026-01-08 19:05:41 +03:00
vrubel
e6c6734768 Enhance YouTube downloader with improved cookie validation and download strategies. Update cookie extraction script for better error handling and user feedback. 2025-12-25 21:38:13 +03:00
vrubel
a918f93dfa Implement file deletion after successful video sending and update Instagram cookies 2025-12-25 00:35:48 +03:00
vrubel
9a64e1e6b8 вк япфайлс расширил домены 2025-12-25 00:09:47 +03:00
vrubel
88d753b84a Enhance YouTube video download functionality with improved error handling and format options. Update Docker configuration to use environment variable for port and simplify network settings. 2025-12-24 22:41:20 +03:00
vrubel
2d248b9ce0 add admin bot 2025-12-20 22:17:20 +03:00
vrubel
8a20b91c54 stats errors 2025-12-20 05:22:55 +03:00
vrubel
1c99e109b8 optimization scripts update coockies 2025-12-20 04:58:52 +03:00
vrubel
08c1cdf09c Add YouTube cookies to repository 2025-12-17 17:54:39 +03:00
vrubel
fdaaddff98 Improve YouTube cookies handling and script 2025-12-17 17:53:34 +03:00
vrubelroman
1e7f3be3f3 fix bug 2025-12-16 10:54:54 +03:00
vrubelroman
1a54f10ea2 добавили куки для ютуба 2025-12-16 10:15:50 +03:00
vrubelroman
c8feb4b78b убраны упоминания команд 2025-12-12 17:05:28 +03:00
vrubelroman
a9cea44bf6 убрал @rvrubel 2025-12-12 17:00:31 +03:00
vrubelroman
0ba861898d Updated error messages for file size limitations in both Russian and English to clarify maximum allowed size for video uploads. 2025-12-12 16:27:29 +03:00
vrubelroman
b4bb2e63eb fix 2025-12-12 16:01:06 +03:00
vrubelroman
e3b1dd0d1c Обновлены таймауты для отправки видео в Telegram, чтобы улучшить обработку больших файлов. Исправлены значения cookie для Instagram. 2025-12-12 15:58:19 +03:00
vrubelroman
76ce3feecc Добавлена система очередей для обработки загрузки видео, улучшена обработка ошибок и добавлены новые текстовые сообщения для пользователей. Обновлены таймауты HTTP-запросов для поддержки больших файлов. Обновлены конфигурации Docker для всех загрузчиков с использованием Gunicorn. 2025-12-12 15:41:46 +03:00
vrubelroman
e441f53760 Добавлен новый сервис для загрузки видео с Yapfiles, обновлены конфигурации и текстовые сообщения для поддержки нового источника. Улучшена обработка ошибок и обновлена документация. 2025-12-12 14:45:56 +03:00
vrubelroman
77d3704909 Обновлена архитектура и документация: добавлены новые сервисы для TikTok и Yapfiles, обновлены порты для всех загрузчиков, улучшена локализация и добавлены команды бота. Обновлены инструкции по запуску и настройке. 2025-12-12 12:39:11 +03:00
vrubelroman
da98462bbc Добавлен TikTok загрузчик: обновлены конфигурации, добавлены функции для скачивания видео с TikTok и обновлены текстовые сообщения для поддержки нового источника. 2025-12-12 12:36:23 +03:00
vrubelroman
95d1ce4f9a Обновлено подтверждение перед отправкой сообщения: добавлена обработка исключений для ввода пользователя, чтобы избежать ошибок при некорректном вводе. 2025-12-12 11:34:20 +03:00