sudo-soldier commited on
Commit
ae98033
·
verified ·
1 Parent(s): c0b3064

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -32,12 +32,12 @@ def download_video(url):
32
  output_path = os.path.join(DOWNLOAD_FOLDER, '%(title)s.mp4')
33
  command = ['yt-dlp', '-f', 'mp4', '-o', output_path, url]
34
 
35
- # Add cookies to the yt-dlp command
36
  if os.path.exists(COOKIES_PATH):
37
  command.extend(['--cookies', COOKIES_PATH])
38
  else:
39
  return f"Error: Cookies file {COOKIES_PATH} not found."
40
-
41
  # Add the sleep interval flag to delay between requests
42
  command.extend(['--sleep-interval', '10']) # 10 seconds between requests to avoid rate-limiting
43
 
@@ -139,3 +139,4 @@ iface.launch(share=True)
139
 
140
 
141
 
 
 
32
  output_path = os.path.join(DOWNLOAD_FOLDER, '%(title)s.mp4')
33
  command = ['yt-dlp', '-f', 'mp4', '-o', output_path, url]
34
 
35
+ # Add cookies to the yt-dlp command if the cookies.txt exists
36
  if os.path.exists(COOKIES_PATH):
37
  command.extend(['--cookies', COOKIES_PATH])
38
  else:
39
  return f"Error: Cookies file {COOKIES_PATH} not found."
40
+
41
  # Add the sleep interval flag to delay between requests
42
  command.extend(['--sleep-interval', '10']) # 10 seconds between requests to avoid rate-limiting
43
 
 
139
 
140
 
141
 
142
+