diff options
author | Jesus <heckyel@riseup.net> | 2023-09-04 01:59:36 +0800 |
---|---|---|
committer | Jesus <heckyel@riseup.net> | 2023-09-04 01:59:36 +0800 |
commit | b3013540b41d1eb77c4803c5fca46f8d75b40fc1 (patch) | |
tree | 97735cb0c49f3a2b0f276e1cd90817833d590d69 /hypervideo_dl/extractor/mailru.py | |
parent | eaeeef9c1d1bedb76fea953c332ef84d53bffe2c (diff) | |
download | hypervideo-b3013540b41d1eb77c4803c5fca46f8d75b40fc1.tar.lz hypervideo-b3013540b41d1eb77c4803c5fca46f8d75b40fc1.tar.xz hypervideo-b3013540b41d1eb77c4803c5fca46f8d75b40fc1.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/mailru.py')
-rw-r--r-- | hypervideo_dl/extractor/mailru.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/hypervideo_dl/extractor/mailru.py b/hypervideo_dl/extractor/mailru.py index 387d211..0f0550c 100644 --- a/hypervideo_dl/extractor/mailru.py +++ b/hypervideo_dl/extractor/mailru.py @@ -1,6 +1,7 @@ import itertools import json import re +import urllib.parse from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote @@ -140,17 +141,15 @@ class MailRuIE(InfoExtractor): 'http://api.video.mail.ru/videos/%s.json?new=1' % video_id, video_id, 'Downloading video JSON') - headers = {} - video_key = self._get_cookies('https://my.mail.ru').get('video_key') - if video_key: - headers['Cookie'] = 'video_key=%s' % video_key.value formats = [] for f in video_data['videos']: video_url = f.get('url') if not video_url: continue + if video_key: + self._set_cookie(urllib.parse.urlparse(video_url).hostname, 'video_key', video_key.value) format_id = f.get('key') height = int_or_none(self._search_regex( r'^(\d+)[pP]$', format_id, 'height', default=None)) if format_id else None @@ -158,7 +157,6 @@ class MailRuIE(InfoExtractor): 'url': video_url, 'format_id': format_id, 'height': height, - 'http_headers': headers, }) meta_data = video_data['meta'] |