Skip to content

Commit

Permalink
[mailru] Fix extraction (closes #24530) (#25239)
Browse files Browse the repository at this point in the history
  • Loading branch information
comsomisha authored and bbepis committed May 14, 2020
1 parent dec00b7 commit bf7e37c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions youtube_dl/extractor/mailru.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ def _real_extract(self, url):
'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')
Expand All @@ -140,6 +146,7 @@ def _real_extract(self, url):
'url': video_url,
'format_id': format_id,
'height': height,
'http_headers': headers,
})
self._sort_formats(formats)

Expand Down

0 comments on commit bf7e37c

Please sign in to comment.