Fix broken yt-dlp configuration

This commit is contained in:
alejo committed 2026-09-23 22:12:31 -03:00
1 parent 3c29b483c7
commit 09dec06a39
1 file changed
+14 -1
+14 -1
View File
@@ -91,19 +91,32 @@ def _base_opts(extra=None):
opts = {
"cachedir": CACHE_DIR,
"js_runtimes": {"node": {"executable": "/usr/bin/node"}},
# MUST be a list. Allows yt-dlp to download the JS solver via Node.
"remote_components": ["ejs:github"],
# Bypass the broken 'tv_downgraded' client when using cookies.
# Forces fallback to default or web_embedded clients.
"extractor_args": {
"youtube": ["player_client=default,web_embedded"]
},
"http_headers": {"User-Agent": _random_ua()},
"http_chunk_size": 10 * 1024 * 1024,
"socket_timeout": 30,
"retries": 6,
"fragment_retries": 6,
"source_address": "0.0.0.0",
}
if os.path.isfile(COOKIES_FILE):
opts["cookiefile"] = COOKIES_FILE
if extra:
opts.update(extra)
return opts
def sanitize_filename(name):
return re.sub(r'[\\/*?:"<>|]', "_", name)