jpjp9292 commited on
Commit
5b39ff7
·
verified ·
1 Parent(s): b066d3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -404,7 +404,7 @@ def get_download_options(session_headers=None):
404
  return options
405
 
406
  def download_with_retry(url, progress_callback):
407
- """Enhanced download function with multiple retry strategies"""
408
  for attempt in range(Config.MAX_RETRIES):
409
  try:
410
  session = SessionManager.get_session()
@@ -422,7 +422,7 @@ def download_with_retry(url, progress_callback):
422
 
423
  ydl_opts['progress_hooks'] = [progress_hook]
424
 
425
- # Actual download
426
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
427
  info = ydl.extract_info(url, download=True)
428
  filename = ydl.prepare_filename(info)
@@ -448,6 +448,7 @@ def download_with_retry(url, progress_callback):
448
 
449
  return None, "Maximum retries reached. Please try again later."
450
 
 
451
  # UI Components
452
  def render_main_ui():
453
  col1, col2 = st.columns([2, 1])
 
404
  return options
405
 
406
  def download_with_retry(url, progress_callback):
407
+ """Enhanced download function with multiple retry strategies and better bot protection."""
408
  for attempt in range(Config.MAX_RETRIES):
409
  try:
410
  session = SessionManager.get_session()
 
422
 
423
  ydl_opts['progress_hooks'] = [progress_hook]
424
 
425
+ # Attempt download with session headers and cookies
426
  with yt_dlp.YoutubeDL(ydl_opts) as ydl:
427
  info = ydl.extract_info(url, download=True)
428
  filename = ydl.prepare_filename(info)
 
448
 
449
  return None, "Maximum retries reached. Please try again later."
450
 
451
+
452
  # UI Components
453
  def render_main_ui():
454
  col1, col2 = st.columns([2, 1])