[WIP] Fix download error for video clips #15
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix Download Error - Complete ✅
Changes Made:
Problem Summary:
Users encountered "Requested format is not available" errors when downloading YouTube videos with
download_clips.py, resulting in empty subdirectories despite the script attempting downloads.Root Causes:
bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/bestwas too specific-cwhile primary used--no-continueSolution Implemented:
1. Improved Primary Format Selection (Line 232):
Allows any video+audio combination as fallback before going to single best format.
2. Fixed Flag Inconsistency (Line 260):
Maintains consistency with primary command.
3. Multi-Layer Fallback Strategy:
4. Enhanced Error Detection (Line 252):
Catches more format-related errors with case-insensitive matching.
Validation Complete:
✅ Syntax Check: Passed
✅ Security Scan: 0 vulnerabilities found
✅ Error Detection: All test patterns correctly detected
✅ Function Signature: Verified and unchanged
Testing Instructions:
Create a test JSON with the problematic video:
[ { "info": { "Video Link": "https://www.youtube.com/watch?v=3kAiPSEnrHI" }, "start-time": 246.846, "end-time": 251.888 } ]Run:
python download_clips.py --input test.json --output test_output --limit 1The script will now gracefully handle format availability issues through three progressive fallback attempts.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.