[PeerTube] Check captions and desc are dict before accessing
This commit is contained in:
parent
37a15bc93b
commit
7057804c94
@ -489,7 +489,7 @@ class PeerTubeIE(InfoExtractor):
|
|||||||
def _get_subtitles(self, host, video_id):
|
def _get_subtitles(self, host, video_id):
|
||||||
video_captions = self._download_json(
|
video_captions = self._download_json(
|
||||||
'https://%s/api/v1/videos/%s/captions' % (host, video_id), video_id, fatal=False)
|
'https://%s/api/v1/videos/%s/captions' % (host, video_id), video_id, fatal=False)
|
||||||
if not video_captions:
|
if not isinstance(video_captions, dict):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
subtitles = {}
|
subtitles = {}
|
||||||
@ -537,10 +537,10 @@ class PeerTubeIE(InfoExtractor):
|
|||||||
video_description = self._download_json(
|
video_description = self._download_json(
|
||||||
'https://%s/api/v1/videos/%s/description' % (host, video_id), video_id, fatal=False)
|
'https://%s/api/v1/videos/%s/description' % (host, video_id), video_id, fatal=False)
|
||||||
|
|
||||||
description = ""
|
description = None
|
||||||
if video_description:
|
if isinstance(video_description, dict):
|
||||||
description = video_description.get('description')
|
description = video_description.get('description')
|
||||||
|
|
||||||
subtitles = self.extract_subtitles(host, video_id)
|
subtitles = self.extract_subtitles(host, video_id)
|
||||||
|
|
||||||
def account_data(field):
|
def account_data(field):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user