Skip to content

Retry InnerTube POST on HTTP 429 so rotating proxies can switch IPs - #614

Open
DSeaStar wants to merge 1 commit into
jdepoix:masterfrom
DSeaStar:fix/retry-innertube-post-429
Open

Retry InnerTube POST on HTTP 429 so rotating proxies can switch IPs#614
DSeaStar wants to merge 1 commit into
jdepoix:masterfrom
DSeaStar:fix/retry-innertube-post-429

Conversation

@DSeaStar

Copy link
Copy Markdown

Summary

  • retries_when_blocked mounts an urllib3 Retry with status_forcelist=[429], but urllib3 only retries idempotent methods by default (HEAD/GET/PUT/DELETE/OPTIONS/TRACE).
  • Transcript listing hits InnerTube via POST (_fetch_innertube_data). A 429 there was never retried, so rotating proxies never got a new IP and IpBlocked was raised on the first hit.
  • Include POST in allowed_methods so a 429 on that request retries as the proxy config already documents.

Fixes #612

Test plan

  • Added test_retry_config_retries_post_on_429 asserting the mounted Retry includes POST, 429, and retries_when_blocked
  • Existing proxy retry tests still pass (test_fetch__with_proxy_retry_when_blocked and related)
  • ruff format / ruff check (0.6.8) on the touched files

urllib3 Retry omits POST by default, so retries_when_blocked never fired
on the listing request and raised IpBlocked on the first 429.
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31810839759

Coverage remained the same at 100.0%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 505
Covered Lines: 505
Line Coverage: 100.0%
Coverage Strength: 7.0 hits per line

💛 - Coveralls

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.

Retry on 429 never rotates IP for InnerTube POST (urllib3 Retry excludes POST by default)

2 participants