Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -38,14 +38,20 @@ def download_video(url):
|
|
38 |
'format': 'bestvideo+bestaudio/best',
|
39 |
'outtmpl': str(output_dir / '%(title)s.%(ext)s'),
|
40 |
'merge_output_format': 'webm',
|
41 |
-
'quiet':
|
42 |
-
'no_warnings':
|
43 |
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
44 |
'referer': 'https://www.youtube.com/',
|
45 |
-
'cookiefile': 'youtube.com_cookies.txt',
|
46 |
'socket_timeout': 30,
|
47 |
-
'http_chunk_size': 10485760,
|
48 |
-
'retries':
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
# Progress placeholder
|
|
|
38 |
'format': 'bestvideo+bestaudio/best',
|
39 |
'outtmpl': str(output_dir / '%(title)s.%(ext)s'),
|
40 |
'merge_output_format': 'webm',
|
41 |
+
'quiet': False, # Change to False to see more detailed error output
|
42 |
+
'no_warnings': False,
|
43 |
'user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
44 |
'referer': 'https://www.youtube.com/',
|
45 |
+
'cookiefile': 'youtube.com_cookies.txt', # Ensure this file path is correct
|
46 |
'socket_timeout': 30,
|
47 |
+
'http_chunk_size': 10485760, # 10MB
|
48 |
+
'retries': 10, # Increase retry attempts
|
49 |
+
'headers': {
|
50 |
+
'Accept-Language': 'en-US,en;q=0.9',
|
51 |
+
'Accept-Encoding': 'gzip, deflate, br',
|
52 |
+
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
|
53 |
+
'Upgrade-Insecure-Requests': '1',
|
54 |
+
}
|
55 |
}
|
56 |
|
57 |
# Progress placeholder
|