diff options
author | comsomisha <shmelev1996@mail.ru> | 2020-05-14 01:51:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 05:51:40 +0700 |
commit | adc13b0748784db87faef580929b1adadaff732e (patch) | |
tree | 13a8ed7319bc0f2bae0548bb86600c3c5003d8ba /youtube_dl/extractor | |
parent | 327593257c64b7f37440bd1ccea0e6935c30e68a (diff) | |
download | youtube-dl-adc13b0748784db87faef580929b1adadaff732e.tar.xz |
[mailru] Fix extraction (closes #24530) (#25239)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/mailru.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/youtube_dl/extractor/mailru.py b/youtube_dl/extractor/mailru.py index 50234798b..65cc474db 100644 --- a/youtube_dl/extractor/mailru.py +++ b/youtube_dl/extractor/mailru.py @@ -128,6 +128,12 @@ 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') @@ -140,6 +146,7 @@ class MailRuIE(InfoExtractor): 'url': video_url, 'format_id': format_id, 'height': height, + 'http_headers': headers, }) self._sort_formats(formats) |