developer28 commited on
Commit
595112b
Β·
verified Β·
1 Parent(s): 24a0a36

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -151,17 +151,18 @@ def test_video_access(url):
151
  'no_warnings': True,
152
  'extract_flat': False,
153
  'skip_download': True,
 
154
  }
155
-
156
  if cookies_path:
157
  ydl_opts['cookiefile'] = cookies_path
158
-
159
  with YoutubeDL(ydl_opts) as ydl:
160
  info_dict = ydl.extract_info(url, download=False)
161
-
162
  status = "βœ… Video accessible"
163
  details = []
164
-
165
  if info_dict.get('title'):
166
  details.append(f"Title: {info_dict['title'][:50]}...")
167
  if info_dict.get('duration'):
@@ -170,9 +171,9 @@ def test_video_access(url):
170
  details.append(f"Availability: {info_dict['availability']}")
171
  if info_dict.get('age_limit'):
172
  details.append(f"Age limit: {info_dict['age_limit']}+")
173
-
174
  return status + "\n" + "\n".join(details)
175
-
176
  except Exception as e:
177
  return f"❌ Video access test failed: {str(e)}"
178
 
 
151
  'no_warnings': True,
152
  'extract_flat': False,
153
  'skip_download': True,
154
+ 'extractor_args': {'youtubetab': 'skip=authcheck'} # βœ… ADD THIS LINE
155
  }
156
+
157
  if cookies_path:
158
  ydl_opts['cookiefile'] = cookies_path
159
+
160
  with YoutubeDL(ydl_opts) as ydl:
161
  info_dict = ydl.extract_info(url, download=False)
162
+
163
  status = "βœ… Video accessible"
164
  details = []
165
+
166
  if info_dict.get('title'):
167
  details.append(f"Title: {info_dict['title'][:50]}...")
168
  if info_dict.get('duration'):
 
171
  details.append(f"Availability: {info_dict['availability']}")
172
  if info_dict.get('age_limit'):
173
  details.append(f"Age limit: {info_dict['age_limit']}+")
174
+
175
  return status + "\n" + "\n".join(details)
176
+
177
  except Exception as e:
178
  return f"❌ Video access test failed: {str(e)}"
179