1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-24 04:56:55 +01:00

[aparat] Fix extraction

This commit is contained in:
Ali Irani 2018-09-06 02:08:38 +04:30 committed by Sergey M․
parent 9ff558f67f
commit 9c4a83a1be
No known key found for this signature in database
GPG Key ID: 2C393E0F18A9236D

View File

@ -34,17 +34,18 @@ class AparatIE(InfoExtractor):
'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:
file_url = url_or_none(item.get('src'))
if not file_url: if not file_url:
continue continue
ext = mimetype2ext(item.get('type')) ext = mimetype2ext(item.get('type'))
@ -58,8 +59,7 @@ class AparatIE(InfoExtractor):
}) })
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,