yt-dlp-dags/ytops_client/request_params_help.py

49 lines
2.5 KiB
Python

# Using a separate file for this long help message to keep the main script clean.
# It's imported by client tools that use the --request-params-json argument.
REQUEST_PARAMS_HELP_STRING = """JSON string with per-request parameters to override server defaults.
Example of a full configuration JSON showing default values (use single quotes to wrap it):
'{
"_comment": "This JSON object allows overriding server-side defaults for a single request.",
"cookies_file_path": "/path/to/your/cookies.txt",
"context_reuse_policy": {
"enabled": true,
"max_age_seconds": 86400,
"reuse_visitor_id": true,
"reuse_cookies": true
},
"_comment_context_reuse_policy": "Controls how the server reuses session context (cookies, visitor ID) from the account's previous successful request.",
"_comment_reuse_visitor_id": "If true, reuses the visitor ID from the last session to maintain a consistent identity to YouTube. This is automatically disabled for TV clients to avoid bot detection.",
"ytdlp_params": {
"use_curl_prefetch": false,
"skip_cache": false,
"visitor_id_override_enabled": true,
"extractor_args": {
"youtubepot-bgutilhttp": {
"base_url": "http://172.17.0.1:4416"
},
"youtube": {
"pot_trace": "true",
"formats": "duplicate",
"player_js_version": "actual"
},
"youtubepot-webpo": {
"bind_to_visitor_id": "true"
}
}
},
"_comment_ytdlp_params": "Parameters passed directly to the yt-dlp wrapper for info.json generation.",
"_comment_visitor_id_override_enabled": "If true (default), the server validates the visitor ID from the token generator and creates a new one if it is invalid. Set to false to force using the provided visitor ID without validation, which is useful for debugging.",
"_comment_extractor_args": "Directly override yt-dlp extractor arguments. To use BGUtils in script mode, replace 'youtubepot-bgutilhttp' with 'youtubepot-bgutilscript'. The script path is '/opt/bgutil-ytdlp-pot-provider-server/build/generate_once.js'. To disable any explicit provider (like '--bgutils-mode none' on the server), remove both 'youtubepot-bgutilhttp' and 'youtubepot-bgutilscript' keys.",
"session_params": {
"lang": "en-US",
"location": "US",
"deviceCategory": "MOBILE",
"user_agent": "Mozilla/5.0 (iPad; CPU OS 16_7_10 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1,gzip(gfe)"
},
"_comment_session_params": "Parameters for the token generation session (primarily for Node.js)."
}'"""