Skip to content

Provision curl_cffi so yt-dlp's Reddit workaround runs as designed - #27

Merged
miridius merged 1 commit into
mainfrom
provision-yt-dlp-impersonation
Jul 25, 2026
Merged

Provision curl_cffi so yt-dlp's Reddit workaround runs as designed#27
miridius merged 1 commit into
mainfrom
provision-yt-dlp-impersonation

Conversation

@miridius

@miridius miridius commented Jul 25, 2026

Copy link
Copy Markdown
Owner

Problem

Reddit is removing anonymous JSON API access; when its rolling enforcement bites, scrapes fail with HTTP Error 429 (observed twice in production logs on 2026-07-24/25, where a non-video link then drew a group error reply because the scrape failed before the bot could classify the link). yt-dlp's merged workaround (yt-dlp/yt-dlp#16839) bootstraps a session using browser impersonation, and its author notes the bootstrap 403s without that capability (yt-dlp/yt-dlp#16877). Both our images lack the impersonation dependency the workaround requires, so by upstream's account the bot runs it degraded.

Fix

Install curl_cffi in both images, via python3-pip with --no-cache-dir, stripping python3-pip again after use. In the built images curl_cffi imports, yt-dlp reports impersonation targets available, and pip is absent at runtime.

Not verified empirically against the failure itself: enforcement isn't currently biting, so a with/without comparison cannot discriminate right now. This ships on the upstream maintainers' documented requirement; if 429 windows recur with this in place, the investigation reopens.

@miridius
miridius force-pushed the provision-yt-dlp-impersonation branch from 3bb0303 to e107230 Compare July 25, 2026 19:30
yt-dlp's merged fix for Reddit's anonymous-API removal bootstraps its session
with browser impersonation, which silently degrades without curl_cffi
installed (yt-dlp/yt-dlp#16877): scrapes then fail with 429s whenever
Reddit's rolling enforcement tightens. Both images now install it and strip
the build-only pip afterward.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DL3md3a3RoeRNStaDv1PDf
@miridius
miridius force-pushed the provision-yt-dlp-impersonation branch from e107230 to 34474e8 Compare July 25, 2026 19:33
@miridius
miridius merged commit 89eae28 into main Jul 25, 2026
3 checks passed
@miridius
miridius deleted the provision-yt-dlp-impersonation branch July 25, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant