Skip to content

Commit 08a3d80

Browse files
fix: handle yt-dlp GitHub API rate limit gracefully
When yt-dlp -U hits GitHub's API rate limit (HTTP 403), skip the step gracefully instead of reporting a hard failure. The rate limit is transient and not actionable by the user during the run. Tested: full topgrade run completes with 0 failures. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 8015db3 commit 08a3d80

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/steps/generic.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2563,8 +2563,17 @@ pub fn run_ytdlp(ctx: &ExecutionContext) -> Result<()> {
25632563
return Ok(());
25642564
}
25652565

2566-
// Check if it failed due to a permission error (e.g., installed to /usr/local/bin)
25672566
let combined_lower = combined.to_lowercase();
2567+
2568+
// If it hit a GitHub API rate limit, skip gracefully instead of failing
2569+
if combined_lower.contains("rate limit") {
2570+
std::io::stderr().lock().write_all(&output.stderr).unwrap();
2571+
return Err(
2572+
SkipStep("yt-dlp update skipped: GitHub API rate limit exceeded, try again later".to_string()).into(),
2573+
);
2574+
}
2575+
2576+
// Check if it failed due to a permission error (e.g., installed to /usr/local/bin)
25682577
if combined_lower.contains("unable to write") || combined_lower.contains("permission denied") {
25692578
// Retry with sudo
25702579
let sudo = ctx.require_sudo()?;

0 commit comments

Comments
 (0)