Add scripts to pull only /server/ section of pots generator, adn only install at runtime.

This commit is contained in:
erinhmclark
2025-03-18 13:47:01 +00:00
parent 0c892f3cf1
commit cb632723bd
4 changed files with 69 additions and 24 deletions

View File

@@ -74,8 +74,12 @@ If you are having issues with the extractor, you can review the version of `yt-d
"default": "inf",
"help": "Use to limit the number of videos to download when a channel or long page is being extracted. 'inf' means no limit.",
},
"update_pots": {
"default": False,
"help": "If set, will run the script to update the pot generation script.",
},
"extractor_args": {
"default": {"youtube": {"getpot_bgutil_script": "scripts/potoken_provider/bgutil-ytdlp-pot-provider/server/build/generate_once.js"}},
"default": {},
"help": "Additional arguments to pass to the yt-dlp extractor. See https://github.com/yt-dlp/yt-dlp/blob/master/README.md#extractor-arguments.",
"type": "json_loader",
},

View File

@@ -73,7 +73,8 @@ class GenericExtractor(Extractor):
# Determine the default location for the transpiled PO token script.
default_script = os.path.join(
"scripts", "potoken_provider", "bgutil-ytdlp-pot-provider", "server", "build", "generate_once.js"
# "scripts", "potoken_provider", "bgutil-server", "build", "generate_once.js"
"scripts", "potoken_provider", "bgutil-provider", "server", "build", "generate_once.js"
)
# Check if the PO token script exists. if not, trigger the script generation.
if not os.path.exists(default_script):
@@ -445,6 +446,8 @@ class GenericExtractor(Extractor):
"--write-subs" if self.subtitles else "--no-write-subs",
"--write-auto-subs" if self.subtitles else "--no-write-auto-subs",
"--live-from-start" if self.live_from_start else "--no-live-from-start",
# TODO
"--verbose"
]
# proxy handling