X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/c8c68895a8818fe160e81ce9c6f8baea38fe3051..2dbb05e5969fc6d6b5d51b6bb9576b03fb63d936:/youtube_dl/extractor/mailru.py?ds=inline diff --git a/youtube_dl/extractor/mailru.py b/youtube_dl/extractor/mailru.py index 5023479..65cc474 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)