Skip to content

Retry URL imports as a browser when a site answers 403 (fixes Rumble) - #74

Merged
davior merged 1 commit into
mainfrom
claude/trusting-fermat-9tfwwy
Nov 7, 2026
Merged

davior merged 1 commit into
mainfrom
claude/trusting-fermat-9tfwwy

Conversation

@davior

@davior davior commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Rumble imports fail with Unable to download webpage: HTTP Error 403: Forbidden. Rumble is now behind Cloudflare's bot screen, which refuses yt-dlp's Python client based on its TLS handshake. Headers and cookies don't help, and Rumble's extractor is unchanged between our pin and the newest yt-dlp, so a version bump alone won't fix it.

Changes

  • backend/requirements.txt:
    • yt-dlp[default,deno,curl-cffi]==2026.10.26.
    • Pin curl-cffi==0.17.0 to the range that release's extra accepts. abi3 manylinux wheels exist for x86_64 and aarch64, so nothing compiles on 3.13.
  • app/ingest/ytdlp.py:
    • New _extract helper. If a probe or download fails with 403, it retries once with impersonate=ImpersonateTarget(), which presents a Chrome/Safari TLS fingerprint through curl_cffi.
    • Impersonation is only tried on a 403, so YouTube and other working sites keep yt-dlp's own client.
    • If curl_cffi is missing, the original 403 is re-raised.
    • readable_error now turns a 403 that persists into advice: rebuild the image, or use URL_IMPORT_COOKIES_FILE.
  • Tests: retry succeeds; a 403 that survives the retry; a 403 with curl_cffi unavailable; non-403 failures are not retried.
  • docs/url-import.md: a short section on 403s and impersonation.

Testing

  • pytest -q: whole backend suite passes. gecko-suite-client was installed from a local checkout of the pinned commit.
  • Checked in a real venv that yt-dlp 2026.10.26 with curl_cffi 0.17.0 lists the impersonation targets.
  • Not tested against rumble.com itself: this sandbox's network doesn't allow it.

Deploy with docker compose up --build -d, since the image needs the new dependency.


Generated by Claude Code

Rumble now sits behind Cloudflare's bot screen, which refuses yt-dlp's
Python client on its TLS fingerprint: "Unable to download webpage: HTTP
Error 403: Forbidden". yt-dlp can handshake like Chrome through curl_cffi,
which the install did not include.

Add the curl-cffi extra (pinned to 0.17.0, abi3 wheels for x86_64 and
aarch64), bump yt-dlp to 2026.10.26, and retry a probe or download once
with impersonation when it fails with 403. Other sites keep yt-dlp's own
client. A 403 that survives the retry, or that cannot be retried because
curl_cffi is missing, now says what to do instead of yt-dlp's raw line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1geD4inqJxe1F6HuWV82R
@davior
davior marked this pull request as ready for review November 7, 2026 03:15
@davior
davior merged commit fce1d92 into main Nov 7, 2026
3 checks passed
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.

2 participants