prasanth.thangavel commited on
Commit
0d1e776
·
1 Parent(s): 901a06f

Add option for public deployment without authentication (i.e. no cookies)

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -155,6 +155,8 @@ def download_for_browser(url, mode='audio', quality='high'):
155
  logger.info(f"Using Firefox cookies: {USE_FIREFOX_COOKIES}")
156
  if USE_FIREFOX_COOKIES == "True":
157
  opts["cookiefile"] = "firefox-cookies.txt" #create_temp_cookie_file()
 
 
158
 
159
  # Download file
160
  logger.info(f"Downloading {url} with options: {opts}")
 
155
  logger.info(f"Using Firefox cookies: {USE_FIREFOX_COOKIES}")
156
  if USE_FIREFOX_COOKIES == "True":
157
  opts["cookiefile"] = "firefox-cookies.txt" #create_temp_cookie_file()
158
+ else:
159
+ opts["no_cookies"] = True # Forces yt-dlp to access YouTube without any authentication
160
 
161
  # Download file
162
  logger.info(f"Downloading {url} with options: {opts}")