mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-12 10:11:07 +01:00
[vk] Improve login
This commit is contained in:
parent
2d19fb5072
commit
5f5a9d6158
@ -53,13 +53,14 @@ def _login(self):
|
|||||||
# 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')
|
cookies = url_handle.headers.get('Set-Cookie')
|
||||||
if sys.version_info[0] >= 3:
|
if cookies:
|
||||||
cookies = cookies.encode('iso-8859-1')
|
if sys.version_info[0] >= 3:
|
||||||
cookies = cookies.decode('utf-8')
|
cookies = cookies.encode('iso-8859-1')
|
||||||
remixlhk = re.search(r'remixlhk=(.+?);.*?\bdomain=(.+?)(?:[,;]|$)', cookies)
|
cookies = cookies.decode('utf-8')
|
||||||
if remixlhk:
|
remixlhk = re.search(r'remixlhk=(.+?);.*?\bdomain=(.+?)(?:[,;]|$)', cookies)
|
||||||
value, domain = remixlhk.groups()
|
if remixlhk:
|
||||||
self._set_cookie(domain, 'remixlhk', value)
|
value, domain = remixlhk.groups()
|
||||||
|
self._set_cookie(domain, 'remixlhk', value)
|
||||||
|
|
||||||
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 New Issue
Block a user