yt-dlp-dags/ytops_client/request_params_help.py

56 lines
2.1 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 --ytdlp-config-json argument.
REQUEST_PARAMS_HELP_STRING = """JSON string or path to a JSON file (prefixed with '@') containing per-request parameters.
This allows overriding server-side defaults and passing a full yt-dlp options dictionary.
If this argument is not provided, the tool will automatically look for and load 'ytdlp.json'
in the current directory if it exists.
The JSON structure is unified:
1. 'ytops': Parameters that control the behavior of the yt-ops-server itself (for 'get-info').
2. 'ytdlp_params': A dictionary of options passed directly to yt-dlp. This is used by both
'get-info' (server-side) and 'download py' (client-side).
Example 'ytdlp.json' for getting info.json and for downloads:
{
// --- YTOPS: Server-Side Controls (for 'get-info') ---
"ytops": {
"assigned_proxy_url": "socks5://your.proxy.com:1080", // Optional: Assign a specific proxy
"force_renew": ["cookies", "visitor_id"],
"session_params": {
"visitor_rotation_threshold": 0,
"prevent_cookie_rotation": false,
"prevent_visitor_rotation": false
}
},
// --- YTDLP: Parameters for yt-dlp (for 'get-info' and 'download py') ---
"ytdlp_params": {
"verbose": true,
"socket_timeout": 60,
"http_headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
},
"extractor_args": {
"youtube": {
"player_client": ["tv_simply"],
"skip": ["translated_subs", "hls"],
"pot_trace": ["true"],
"jsc_trace": ["true"],
"formats": ["duplicate"],
"lang": ["en-US"],
"timeZone": ["UTC"]
},
"youtubepot-bgutilhttp": {
"base_url": ["http://172.17.0.1:4416"]
}
},
"format_sort": ["res", "ext:mp4:m4a"],
"remuxvideo": "mp4"
}
}
You can also pass a minimal JSON string directly on the command line:
'{"ytops": {"force_renew": ["all"]}, "ytdlp_params": {"verbose": true}}'
"""