mirror of
				https://github.com/ytdl-org/youtube-dl
				synced 2025-10-25 09:38:38 +09:00 
			
		
		
		
	Add and implement --client-certificate option
Use a PEM certificate to authenticate HTTPS access to site
This commit is contained in:
		| @@ -320,6 +320,7 @@ def _real_main(argv=None): | ||||
|         'password': opts.password, | ||||
|         'twofactor': opts.twofactor, | ||||
|         'videopassword': opts.videopassword, | ||||
|         'clientcertificate': opts.clientcertificate, | ||||
|         'ap_mso': opts.ap_mso, | ||||
|         'ap_username': opts.ap_username, | ||||
|         'ap_password': opts.ap_password, | ||||
|   | ||||
| @@ -370,6 +370,10 @@ def parseOpts(overrideArguments=None): | ||||
|         '--video-password', | ||||
|         dest='videopassword', metavar='PASSWORD', | ||||
|         help='Video password (vimeo, youku)') | ||||
|     authentication.add_option( | ||||
|         '--client-certificate', | ||||
|         dest='clientcertificate', metavar='PATH', | ||||
|         help='Path to a single certificate file in PEM format, used to authenticate to the site') | ||||
|  | ||||
|     adobe_pass = optparse.OptionGroup(parser, 'Adobe Pass Options') | ||||
|     adobe_pass.add_option( | ||||
|   | ||||
| @@ -2477,6 +2477,10 @@ def _create_http_connection(ydl_handler, http_class, is_https, *args, **kwargs): | ||||
|     # https://github.com/ytdl-org/youtube-dl/issues/6727) | ||||
|     if sys.version_info < (3, 0): | ||||
|         kwargs['strict'] = True | ||||
|     if is_https: | ||||
|         client_cert_path = ydl_handler._params.get('clientcertificate') | ||||
|         if client_cert_path: | ||||
|             kwargs['cert_file'] = client_cert_path | ||||
|     hc = http_class(*args, **compat_kwargs(kwargs)) | ||||
|     source_address = ydl_handler._params.get('source_address') | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 df
					df