From fc8b4a3be9741da99c043da3f9e9aa7f1c386994 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sun, 8 Sep 2024 17:27:33 +1200 Subject: [PATCH] Expose CLI args --- README.md | 13 +++++++++++++ yt_dlp/__init__.py | 4 ++++ yt_dlp/options.py | 18 ++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/README.md b/README.md index ca32e09bfb..d29c3ceb15 100644 --- a/README.md +++ b/README.md @@ -777,6 +777,7 @@ ## Workarounds: that do not support RFC 5746 secure renegotiation --no-check-certificates Suppress HTTPS certificate validation + --no-check-proxy-certificates Suppress HTTPS Proxy certificate validation --prefer-insecure Use an unencrypted connection to retrieve information about the video (Currently supported only for YouTube) @@ -882,6 +883,18 @@ ## Authentication Options: Password for client certificate private key, if encrypted. If not provided, and the key is encrypted, yt-dlp will ask interactively + --proxy-client-certificate CERTFILE + Path to client certificate file in PEM + format for HTTPS proxy. May include the + private key + --proxy-client-certificate-key KEYFILE + Path to private key file for client + certificate for HTTPS proxy + --proxy-client-certificate-password PASSWORD + Password for client certificate private key, + if encrypted, for HTTPS proxy. If not + provided, and the key is encrypted, yt-dlp + will ask interactively ## Post-Processing Options: -x, --extract-audio Convert video files to audio-only files diff --git a/yt_dlp/__init__.py b/yt_dlp/__init__.py index c0b8e3b507..66e64d1ea8 100644 --- a/yt_dlp/__init__.py +++ b/yt_dlp/__init__.py @@ -790,6 +790,9 @@ def parse_options(argv=None): 'client_certificate': opts.client_certificate, 'client_certificate_key': opts.client_certificate_key, 'client_certificate_password': opts.client_certificate_password, + 'proxy_client_certificate': opts.proxy_client_certificate, + 'proxy_client_certificate_key': opts.proxy_client_certificate_key, + 'proxy_client_certificate_password': opts.proxy_client_certificate_password, 'quiet': opts.quiet, 'no_warnings': opts.no_warnings, 'forceurl': opts.geturl, @@ -902,6 +905,7 @@ def parse_options(argv=None): 'cookiesfrombrowser': opts.cookiesfrombrowser, 'legacyserverconnect': opts.legacy_server_connect, 'nocheckcertificate': opts.no_check_certificate, + 'proxy_nocheckcertificate': opts.proxy_no_check_certificate, 'prefer_insecure': opts.prefer_insecure, 'enable_file_urls': opts.enable_file_urls, 'http_headers': opts.headers, diff --git a/yt_dlp/options.py b/yt_dlp/options.py index ffe2463fe2..37117a100f 100644 --- a/yt_dlp/options.py +++ b/yt_dlp/options.py @@ -781,6 +781,20 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs): help='Password for client certificate private key, if encrypted. ' 'If not provided, and the key is encrypted, yt-dlp will ask interactively') + authentication.add_option( + '--proxy-client-certificate', + dest='proxy_client_certificate', metavar='CERTFILE', + help='Path to client certificate file in PEM format for HTTPS proxy. May include the private key') + authentication.add_option( + '--proxy-client-certificate-key', + dest='proxy_client_certificate_key', metavar='KEYFILE', + help='Path to private key file for client certificate for HTTPS proxy') + authentication.add_option( + '--proxy-client-certificate-password', + dest='proxy_client_certificate_password', metavar='PASSWORD', + help='Password for client certificate private key, if encrypted, for HTTPS proxy. ' + 'If not provided, and the key is encrypted, yt-dlp will ask interactively') + video_format = optparse.OptionGroup(parser, 'Video Format Options') video_format.add_option( '-f', '--format', @@ -1084,6 +1098,10 @@ def _alias_callback(option, opt_str, value, parser, opts, nargs): '--no-check-certificates', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation') + workarounds.add_option( + '--no-check-proxy-certificates', + action='store_true', dest='proxy_no_check_certificate', default=False, + help='Suppress HTTPS Proxy certificate validation') workarounds.add_option( '--prefer-insecure', '--prefer-unsecure', action='store_true', dest='prefer_insecure',