[PeerTube] Handle case where captions page does not exist

This commit is contained in:
3risian 2020-01-11 13:13:05 +11:00 committed by GitHub
parent d3d850f0e1
commit 7ea039df34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -489,6 +489,8 @@ class PeerTubeIE(InfoExtractor):
def _get_subtitles(self, host, video_id):
video_captions = self._download_json(
'https://%s/api/v1/videos/%s/captions' % (host, video_id), video_id, fatal=False)
if not video_captions:
return None
subtitles = {}
for entry in video_captions.get('data'):