Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -37,6 +37,10 @@ def download_video(url):
|
|
37 |
command.extend(['--cookies', COOKIES_PATH])
|
38 |
else:
|
39 |
return f"Error: Cookies file {COOKIES_PATH} not found."
|
|
|
|
|
|
|
|
|
40 |
|
41 |
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
42 |
stdout, stderr = process.communicate()
|
@@ -136,4 +140,3 @@ iface.launch(share=True)
|
|
136 |
|
137 |
|
138 |
|
139 |
-
|
|
|
37 |
command.extend(['--cookies', COOKIES_PATH])
|
38 |
else:
|
39 |
return f"Error: Cookies file {COOKIES_PATH} not found."
|
40 |
+
|
41 |
+
# Add additional flags for throttling and retry
|
42 |
+
command.extend(['--sleep-interval', '10']) # Delay between requests to avoid 429 errors
|
43 |
+
command.extend(['--throttled']) # Add throttling to respect YouTube's rate limit
|
44 |
|
45 |
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
46 |
stdout, stderr = process.communicate()
|
|
|
140 |
|
141 |
|
142 |
|
|