1
0
mirror of https://github.com/l1ving/youtube-dl synced 2026-06-01 22:21:10 +08:00

Update mailru.py

This commit is contained in:
Sergey M
2020-05-14 05:50:51 +07:00
committed by GitHub
Unverified
parent 90cb8d994c
commit 1d96155b30
+6 -4
View File
@@ -128,8 +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')
key = 'video_key=%s' % video_key.value
if video_key:
headers['Cookie'] = 'video_key=%s' % video_key.value
formats = []
for f in video_data['videos']:
video_url = f.get('url')
@@ -142,9 +146,7 @@ class MailRuIE(InfoExtractor):
'url': video_url,
'format_id': format_id,
'height': height,
'http_headers': {
'Cookie': key,
},
'http_headers': headers,
})
self._sort_formats(formats)