From 33e90109e6714dab28ef4fe25c02e8dbc0a22af0 Mon Sep 17 00:00:00 2001 From: Petar Kukolj Date: Sat, 6 Oct 2018 19:00:03 +0200 Subject: [PATCH] [videofy.me] Fixed extractor breaking on failed uploader info extraction --- youtube_dl/extractor/videofyme.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/youtube_dl/extractor/videofyme.py b/youtube_dl/extractor/videofyme.py index d511d0e09..be1fea6c6 100644 --- a/youtube_dl/extractor/videofyme.py +++ b/youtube_dl/extractor/videofyme.py @@ -48,17 +48,13 @@ class VideofyMeIE(InfoExtractor): video_info = self._search_json_ld(page, video_id) - uploader_id = self._download_json('https://www.videofy.me/wp-json/wp/v2/posts/%s' % video_id, video_id, fatal=False).get('author') - uploader_name = self._download_json('https://www.videofy.me/wp-json/wp/v2/users/%s' % uploader_id, uploader_id, fatal=False).get('name') + uploader_id = self._download_json('https://www.videofy.me/wp-json/wp/v2/posts/%s' % video_id, video_id, fatal=False) + uploader_id = uploader_id.get('author') if uploader_id != False else None + uploader_name = self._download_json('https://www.videofy.me/wp-json/wp/v2/users/%s' % uploader_id, uploader_id, fatal=False) + uploader_name = uploader_name.get('name') if uploader_name != False else None - return { - 'id': video_id, - 'title': video_info['title'], - 'url': video_info['url'], - 'thumbnail': video_info.get('thumbnail'), - 'description': clean_html(video_info.get('description')), - 'timestamp': video_info.get('timestamp'), - 'uploader_id': uploader_id, - 'uploader': uploader_name, - 'view_count': int_or_none(video_info.get('view_count')), - } + video_info['id'] = video_id + video_info['uploader_id'] = uploader_id + video_info['uploader'] = uploader_name + + return video_info