Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def download():
ydl_opts = {
'format': 'bestaudio',
'outtmpl': f'{DOWNLOAD_FOLDER}/%(title)s.%(ext)s',

'impersonate': 'chrome',
'extractor_args': {
Comment on lines 26 to 30
'youtube': {
'player_client': ['android']
Expand All @@ -35,8 +35,10 @@ def download():

'geo_bypass': True,
'noplaylist': True,
'quiet': False,
'nocheckcertificate': True
'quiet': True,
'no_warnings': True,
'retries': 5,
'extractor_retries': 5
}

else:
Expand All @@ -47,7 +49,7 @@ def download():
'format': f'bestvideo[height<={height}]+bestaudio/best',
'merge_output_format': 'mp4',
'outtmpl': f'{DOWNLOAD_FOLDER}/%(title)s.%(ext)s',

'impersonate': 'chrome',
'extractor_args': {
'youtube': {
'player_client': ['android']
Expand All @@ -56,8 +58,10 @@ def download():

'geo_bypass': True,
'noplaylist': True,
'quiet': False,
'nocheckcertificate': True
'quiet': True,
'no_warnings': True,
'retries': 5,
'extractor_retries': 5
}

try:
Expand Down Expand Up @@ -96,16 +100,9 @@ def cleanup(response):

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 101 to +105

""",400

Expand Down