1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 18:34:32 +01:00

Merge pull request #1 from Marware/aparat-update

Update aparat.py
This commit is contained in:
Marwan Yassin 2019-10-04 23:10:50 +02:00 committed by GitHub
commit 6e903024e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,13 +46,12 @@ 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)
options = self._parse_json( player = self._parse_json(
self._search_regex( self._search_regex(
r'options\s*=\s*JSON\.parse\(\s*(["\'])(?P<value>(?:(?!\1).)+)\1\s*\)', r'options\s*=\s*JSON\.parse\(\s*(["\'])(?P<value>(?:(?!\1).)+)\1\s*\)',
webpage, 'options', group='value'), webpage, 'options', group='value'),
video_id) video_id)
player = options['plugins']['sabaPlayerPlugin']
formats = [] formats = []
for sources in player['multiSRC']: for sources in player['multiSRC']:
@ -89,7 +88,8 @@ class AparatIE(InfoExtractor):
return merge_dicts(info, { return merge_dicts(info, {
'id': video_id, 'id': video_id,
'thumbnail': url_or_none(options.get('poster')), 'thumbnail': url_or_none(player.get('poster')),
'duration': int_or_none(player.get('duration')), 'duration': int_or_none(player.get('duration')),
'formats': formats, 'formats': formats,
}) })