Skip to content

fix: improve fetch_youtube.py reliability and rate-limit handling - #88

Merged
kelleyglenn merged 2 commits into
masterfrom
fix/87-fetch-youtube-reliability
Feb 23, 2026
Merged

fix: improve fetch_youtube.py reliability and rate-limit handling#88
kelleyglenn merged 2 commits into
masterfrom
fix/87-fetch-youtube-reliability

Conversation

@kelleyglenn

@kelleyglenn kelleyglenn commented Feb 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Let yt-dlp handle subtitle downloads via download=True + temp dir so cookies and rate-limit handling apply to subtitle fetches
  • Stop immediately on 429 rate limiting instead of continuing to fail on every subsequent URL
  • Add --cookies-from-browser flag for authenticated YouTube sessions (~6x higher rate limits)
  • Add --delay flag for inter-video throttling
  • Write output incrementally so --append can resume after interruption
  • Remove unnecessary format: "best" that caused errors on some videos

Closes #87

Test plan

  • Verified script fetches metadata + transcripts successfully with --cookies-from-browser firefox --delay 5
  • Verified --append correctly resumes after interruption
  • Verified graceful handling of videos without transcripts (warning, continues)
  • Verified rate-limit detection stops the run with a clear message
  • CI passes

🤖 Generated with Claude Code

kelleyglenn and others added 2 commits February 22, 2026 21:13
- Let yt-dlp handle subtitle downloads via download=True + temp dir
  (carries cookies, retries, and rate-limit handling properly)
- Stop immediately on 429 rate limiting instead of continuing to fail
- Add --cookies-from-browser flag for authenticated sessions (~6x limits)
- Add --delay flag for inter-video throttling
- Write output incrementally so --append can resume after interruption
- Remove unnecessary format selection that broke some videos
- Reduce main() cognitive complexity via helper function extraction

Closes #87

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove unnecessary f-prefix from strings without interpolation.
Set sonar.python.version=3.12 for more precise analysis.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@kelleyglenn
kelleyglenn merged commit bc66a98 into master Feb 23, 2026
1 check passed
@kelleyglenn
kelleyglenn deleted the fix/87-fetch-youtube-reliability branch February 23, 2026 05:27
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.

Improve fetch_youtube.py reliability: cookies, rate-limit handling, incremental writes

1 participant