Browse Source

[vk] Improve login

totalwebcasting
Sergey M․ 8 years ago
parent
commit
5f5a9d6158
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      youtube_dl/extractor/vk.py

+ 8
- 7
youtube_dl/extractor/vk.py View File

@ -53,13 +53,14 @@ class VKBaseIE(InfoExtractor):
# 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:
cookies = cookies.encode('iso-8859-1')
cookies = cookies.decode('utf-8')
remixlhk = re.search(r'remixlhk=(.+?);.*?\bdomain=(.+?)(?:[,;]|$)', cookies)
if remixlhk:
value, domain = remixlhk.groups()
self._set_cookie(domain, 'remixlhk', value)
if cookies:
if sys.version_info[0] >= 3:
cookies = cookies.encode('iso-8859-1')
cookies = cookies.decode('utf-8')
remixlhk = re.search(r'remixlhk=(.+?);.*?\bdomain=(.+?)(?:[,;]|$)', cookies)
if remixlhk:
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…
Cancel
Save