prasanth.thangavel commited on
Commit
4789c01
·
1 Parent(s): 0d1e776

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

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -112,14 +112,15 @@ def download_for_browser(url, mode='audio', quality='high'):
112
  # Create temporary directory that persists until file is served
113
  temp_dir = Path(tempfile.mkdtemp())
114
 
115
- # Convert cookie file to env and save locally
116
- #cookie_file = "cookies.firefox-private.txt"
117
- #env_content = cookies_to_env(cookie_file)
118
- #save_to_env_file(env_content)
119
-
120
- # Convert back to cookie file using .env
121
- cookiefile = "firefox-cookies.txt"
122
- env_to_cookies_from_env("firefox-cookies.txt")
 
123
 
124
  try:
125
  # Configure download options
 
112
  # Create temporary directory that persists until file is served
113
  temp_dir = Path(tempfile.mkdtemp())
114
 
115
+ if USE_FIREFOX_COOKIES == "True":
116
+ # Convert cookie file to env and save locally
117
+ #cookie_file = "cookies.firefox-private.txt"
118
+ #env_content = cookies_to_env(cookie_file)
119
+ #save_to_env_file(env_content)
120
+
121
+ # Convert back to cookie file using .env
122
+ cookiefile = "firefox-cookies.txt"
123
+ env_to_cookies_from_env("firefox-cookies.txt")
124
 
125
  try:
126
  # Configure download options