mirror of
https://github.com/soimort/you-get.git
synced 2025-02-09 03:37:52 +03:00
Niconico: workaround for TLS hang bug, fix #296
This commit is contained in:
parent
13f785e42d
commit
869128c8c7
@ -10,7 +10,12 @@ def nicovideo_login(user, password):
|
|||||||
return response.headers
|
return response.headers
|
||||||
|
|
||||||
def nicovideo_download(url, output_dir='.', merge=True, info_only=False):
|
def nicovideo_download(url, output_dir='.', merge=True, info_only=False):
|
||||||
request.install_opener(request.build_opener(request.HTTPCookieProcessor()))
|
import ssl
|
||||||
|
ssl_context = request.HTTPSHandler(
|
||||||
|
context=ssl.SSLContext(ssl.PROTOCOL_TLSv1))
|
||||||
|
cookie_handler = request.HTTPCookieProcessor()
|
||||||
|
opener = request.build_opener(ssl_context, cookie_handler)
|
||||||
|
request.install_opener(opener)
|
||||||
|
|
||||||
import netrc, getpass
|
import netrc, getpass
|
||||||
info = netrc.netrc().authenticators('nicovideo')
|
info = netrc.netrc().authenticators('nicovideo')
|
||||||
|
Loading…
Reference in New Issue
Block a user