Move the opener to the YoutubeDL object.
This is the first step towards being able to just import youtube_dl and start using it. Apart from removing global state, this would fix problems like #1805.
This commit is contained in:
parent
0b63aed8df
commit
dca0872056
4 changed files with 96 additions and 96 deletions
|
@ -535,7 +535,7 @@ def formatSeconds(secs):
|
|||
else:
|
||||
return '%d' % secs
|
||||
|
||||
def make_HTTPS_handler(opts):
|
||||
def make_HTTPS_handler(opts_no_check_certificate):
|
||||
if sys.version_info < (3,2):
|
||||
# Python's 2.x handler is very simplistic
|
||||
return compat_urllib_request.HTTPSHandler()
|
||||
|
@ -545,7 +545,7 @@ def make_HTTPS_handler(opts):
|
|||
context.set_default_verify_paths()
|
||||
|
||||
context.verify_mode = (ssl.CERT_NONE
|
||||
if opts.no_check_certificate
|
||||
if opts_no_check_certificate
|
||||
else ssl.CERT_REQUIRED)
|
||||
return compat_urllib_request.HTTPSHandler(context=context)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue