EdiBianco commited on
Commit
8abb4d3
·
1 Parent(s): 4e807c0

Fix YouTube SSL block: ios player client + updated yt-dlp

Browse files
Files changed (2) hide show
  1. app.py +10 -0
  2. requirements.txt +1 -1
app.py CHANGED
@@ -246,6 +246,16 @@ async def transcribe_url(url: str = Form(...)):
246
  "progress_hooks": [Hook()],
247
  "quiet": True,
248
  "no_warnings": True,
 
 
 
 
 
 
 
 
 
 
249
  }
250
 
251
  try:
 
246
  "progress_hooks": [Hook()],
247
  "quiet": True,
248
  "no_warnings": True,
249
+ # Bypass YouTube datacenter IP blocks
250
+ "extractor_args": {"youtube": {"player_client": ["ios", "web"]}},
251
+ "http_headers": {
252
+ "User-Agent": (
253
+ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) "
254
+ "AppleWebKit/537.36 (KHTML, like Gecko) "
255
+ "Chrome/124.0.0.0 Safari/537.36"
256
+ ),
257
+ },
258
+ "source_address": "0.0.0.0", # force IPv4
259
  }
260
 
261
  try:
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  fastapi
2
  uvicorn[standard]
3
  faster-whisper
4
- yt-dlp
5
  python-multipart
 
1
  fastapi
2
  uvicorn[standard]
3
  faster-whisper
4
+ yt-dlp>=2024.12.13
5
  python-multipart