Skip to content

Harden YouTube download fallback to pick the largest landed file#34

Merged
alexkroman merged 1 commit into
mainfrom
claude/tender-rubin-Q50NH
Jun 7, 2026
Merged

Harden YouTube download fallback to pick the largest landed file#34
alexkroman merged 1 commit into
mainfrom
claude/tender-rubin-Q50NH

Conversation

@alexkroman

Copy link
Copy Markdown
Collaborator

When yt-dlp's prepared filename doesn't exist (post-processing changed the
extension), download_audio fell back to the first entry from iterdir(), whose
order is arbitrary. yt-dlp can leave sidecars (thumbnail, .info.json, a
leftover .part fragment) in the destination directory, so the fallback could
return a non-audio file that then fails downstream with a confusing decode
error. Pick the largest file instead — the decoded audio track dwarfs any
metadata sidecar.

https://claude.ai/code/session_01QVfdQDhreXWkEHQoArh71E

When yt-dlp's prepared filename doesn't exist (post-processing changed the
extension), download_audio fell back to the first entry from iterdir(), whose
order is arbitrary. yt-dlp can leave sidecars (thumbnail, .info.json, a
leftover .part fragment) in the destination directory, so the fallback could
return a non-audio file that then fails downstream with a confusing decode
error. Pick the largest file instead — the decoded audio track dwarfs any
metadata sidecar.

https://claude.ai/code/session_01QVfdQDhreXWkEHQoArh71E
@alexkroman alexkroman merged commit 4301bba into main Jun 7, 2026
10 checks passed
@alexkroman alexkroman deleted the claude/tender-rubin-Q50NH branch June 7, 2026 23:18
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