Fix broken yt-dlp configuration
This commit is contained in:
1 parent
3c29b483c7
commit
09dec06a39
1 file changed
+14
-1
@@ -91,19 +91,32 @@ def _base_opts(extra=None):
|
|||||||
opts = {
|
opts = {
|
||||||
"cachedir": CACHE_DIR,
|
"cachedir": CACHE_DIR,
|
||||||
"js_runtimes": {"node": {"executable": "/usr/bin/node"}},
|
"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_headers": {"User-Agent": _random_ua()},
|
||||||
"http_chunk_size": 10 * 1024 * 1024,
|
"http_chunk_size": 10 * 1024 * 1024,
|
||||||
"socket_timeout": 30,
|
"socket_timeout": 30,
|
||||||
"retries": 6,
|
"retries": 6,
|
||||||
"fragment_retries": 6,
|
"fragment_retries": 6,
|
||||||
|
"source_address": "0.0.0.0",
|
||||||
}
|
}
|
||||||
|
|
||||||
if os.path.isfile(COOKIES_FILE):
|
if os.path.isfile(COOKIES_FILE):
|
||||||
opts["cookiefile"] = COOKIES_FILE
|
opts["cookiefile"] = COOKIES_FILE
|
||||||
|
|
||||||
if extra:
|
if extra:
|
||||||
opts.update(extra)
|
opts.update(extra)
|
||||||
|
|
||||||
return opts
|
return opts
|
||||||
|
|
||||||
|
|
||||||
def sanitize_filename(name):
|
def sanitize_filename(name):
|
||||||
return re.sub(r'[\\/*?:"<>|]', "_", name)
|
return re.sub(r'[\\/*?:"<>|]', "_", name)
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user