From d8707c6424a7547bda9afd38fe5cd706b8bce0f3 Mon Sep 17 00:00:00 2001 From: Marwan Yassin Date: Fri, 4 Oct 2019 23:04:10 +0200 Subject: [PATCH] Update aparat.py Fix download failures by removing 'plugins' dict dependency and use 'multiSRC' dict directly --- youtube_dl/extractor/aparat.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/aparat.py b/youtube_dl/extractor/aparat.py index 883dcee7a..ebc28e1a4 100644 --- a/youtube_dl/extractor/aparat.py +++ b/youtube_dl/extractor/aparat.py @@ -46,13 +46,12 @@ class AparatIE(InfoExtractor): 'http://www.aparat.com/video/video/embed/vt/frame/showvideo/yes/videohash/' + video_id, video_id) - options = self._parse_json( + player = self._parse_json( self._search_regex( r'options\s*=\s*JSON\.parse\(\s*(["\'])(?P(?:(?!\1).)+)\1\s*\)', webpage, 'options', group='value'), video_id) - player = options['plugins']['sabaPlayerPlugin'] formats = [] for sources in player['multiSRC']: @@ -89,7 +88,8 @@ class AparatIE(InfoExtractor): return merge_dicts(info, { 'id': video_id, - 'thumbnail': url_or_none(options.get('poster')), + 'thumbnail': url_or_none(player.get('poster')), 'duration': int_or_none(player.get('duration')), 'formats': formats, }) +