feat: improve YouTube download reliability#4
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the Flask backend’s yt-dlp configuration to improve YouTube download reliability by changing client behavior and retry settings, and includes a small tweak to the failure response HTML.
Changes:
- Add
impersonate: chromeand use the Android YouTube player client viaextractor_args. - Reduce
yt-dlpoutput noise (quiet,no_warnings) and add retry configuration (retries,extractor_retries). - Simplify the “Go Back” HTML in the error response.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
101
to
+105
| return f""" | ||
| <h2>Download Failed-Retry</h2> | ||
|
|
||
| <p>{str(e)}</p> | ||
|
|
||
| <br> | ||
|
|
||
| <a href="/"> | ||
| <button> | ||
| Go Back | ||
| </button> | ||
| </a> | ||
| <a href="/"><button>Go Back</button></a> |
Comment on lines
26
to
30
| ydl_opts = { | ||
| 'format': 'bestaudio', | ||
| 'outtmpl': f'{DOWNLOAD_FOLDER}/%(title)s.%(ext)s', | ||
|
|
||
| 'impersonate': 'chrome', | ||
| 'extractor_args': { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Update
Made some improvements to make downloads more reliable.
This is Phase 1 of Operation Google Slayer. I'll continue improving reliability in the next updates.