mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-21 20:46:36 -05:00
[aparat] Fix extraction
This commit is contained in:
parent
9ff558f67f
commit
9c4a83a1be
1 changed files with 18 additions and 18 deletions
|
@ -34,32 +34,32 @@ def _real_extract(self, url):
|
||||||
'http://www.aparat.com/video/video/embed/vt/frame/showvideo/yes/videohash/' + video_id,
|
'http://www.aparat.com/video/video/embed/vt/frame/showvideo/yes/videohash/' + video_id,
|
||||||
video_id)
|
video_id)
|
||||||
|
|
||||||
title = self._search_regex(r'\s+title:\s*"([^"]+)"', webpage, 'title')
|
|
||||||
|
|
||||||
file_list = self._parse_json(
|
file_list = self._parse_json(
|
||||||
self._search_regex(
|
self._search_regex(
|
||||||
r'fileList\s*=\s*JSON\.parse\(\'([^\']+)\'\)', webpage,
|
r'var options\s*=\s*JSON\.parse\(\'([^\']+)\'\)', webpage,
|
||||||
'file list'),
|
'file list'),
|
||||||
video_id)
|
video_id)
|
||||||
|
|
||||||
|
title = file_list['plugins']['sabaPlayerPlugin']['title']
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
for item in file_list[0]:
|
for list in file_list['plugins']['sabaPlayerPlugin']['multiSRC']:
|
||||||
file_url = url_or_none(item.get('file'))
|
for item in list:
|
||||||
if not file_url:
|
file_url = url_or_none(item.get('src'))
|
||||||
continue
|
if not file_url:
|
||||||
ext = mimetype2ext(item.get('type'))
|
continue
|
||||||
label = item.get('label')
|
ext = mimetype2ext(item.get('type'))
|
||||||
formats.append({
|
label = item.get('label')
|
||||||
'url': file_url,
|
formats.append({
|
||||||
'ext': ext,
|
'url': file_url,
|
||||||
'format_id': label or ext,
|
'ext': ext,
|
||||||
'height': int_or_none(self._search_regex(
|
'format_id': label or ext,
|
||||||
r'(\d+)[pP]', label or '', 'height', default=None)),
|
'height': int_or_none(self._search_regex(
|
||||||
})
|
r'(\d+)[pP]', label or '', 'height', default=None)),
|
||||||
|
})
|
||||||
self._sort_formats(formats)
|
self._sort_formats(formats)
|
||||||
|
|
||||||
thumbnail = self._search_regex(
|
thumbnail = file_list['poster']
|
||||||
r'image:\s*"([^"]+)"', webpage, 'thumbnail', fatal=False)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
|
|
Loading…
Reference in a new issue