mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-01-07 17:16:08 +00:00
[vk] Fix authentication on python3
This commit is contained in:
parent
e15ad9ef09
commit
08a42f9c74
|
@ -52,8 +52,9 @@ class VKBaseIE(InfoExtractor):
|
||||||
# what actually happens.
|
# what actually happens.
|
||||||
# We will workaround this VK issue by resetting the remixlhk cookie to
|
# We will workaround this VK issue by resetting the remixlhk cookie to
|
||||||
# the first one manually.
|
# the first one manually.
|
||||||
cookies = url_handle.headers.get('Set-Cookie')
|
for header, cookies in url_handle.headers.items():
|
||||||
if cookies:
|
if header.lower() != 'set-cookie':
|
||||||
|
continue
|
||||||
if sys.version_info[0] >= 3:
|
if sys.version_info[0] >= 3:
|
||||||
cookies = cookies.encode('iso-8859-1')
|
cookies = cookies.encode('iso-8859-1')
|
||||||
cookies = cookies.decode('utf-8')
|
cookies = cookies.decode('utf-8')
|
||||||
|
@ -61,6 +62,7 @@ class VKBaseIE(InfoExtractor):
|
||||||
if remixlhk:
|
if remixlhk:
|
||||||
value, domain = remixlhk.groups()
|
value, domain = remixlhk.groups()
|
||||||
self._set_cookie(domain, 'remixlhk', value)
|
self._set_cookie(domain, 'remixlhk', value)
|
||||||
|
break
|
||||||
|
|
||||||
login_page = self._download_webpage(
|
login_page = self._download_webpage(
|
||||||
'https://login.vk.com/?act=login', None,
|
'https://login.vk.com/?act=login', None,
|
||||||
|
|
Loading…
Reference in a new issue