fix(instagram): восстановить скачивание Reels (curl-cffi + cookies sync)#4
Merged
Conversation
Instagram now requires browser impersonation via curl_cffi in yt-dlp. The Docker image installed plain yt-dlp without that dependency, so reel downloads failed with an empty media response even when cookies were configured. Also sync Instagram/TikTok cookie files from the read-only mount into the writable temp path before yt-dlp runs, matching maintenance and photo fallback behavior. Map empty-media-response errors that mention --cookies to instagram.auth_required so operators know to refresh cookies. Co-authored-by: Daniil Khramov <pyfig@users.noreply.github.com>
Regular users now always see errors.generic on download failures instead of platform-specific messages like instagram.download_failed. Admins (ADMIN_TELEGRAM_ID) get the same generic text plus the underlying execution error to simplify production debugging. Also fix maintenance_test to use context.Background for Go 1.22 CI. Co-authored-by: Daniil Khramov <pyfig@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Проблема
При отправке ссылки на Instagram Reel бот отвечал:
Локальная проверка
yt-dlpна URL из скриншота (/reel/DZdSSJ7I_FM/) воспроизводит ошибкуInstagram sent an empty media response. Instagram теперь требует browser impersonation через зависимостьcurl_cffi, а Docker-образ устанавливалyt-dlpбез этого extra.Изменения
Исправление Instagram Reels
yt-dlp[default,curl-cffi]вместо гологоyt-dlpytdlpOpts— синхронизация cookie-файлов с read-only mount в writable tempUX ошибок (по запросу)
errors.generic(«Что-то пошло не так…») при сбоях загрузкиADMIN_TELEGRAM_ID) — та же общая фраза + блок 🔧 Debug с текстом ошибки исполнения (yt-dlp, send и т.д.)Деплой
Если после деплоя ошибка сохранится — обновить cookies:
Тесты
go test ./internal/worker/...— OK (userFacingError, ytdlpOpts)go test ./internal/ytdlp/...— OKscripts/check-parity.sh— OK