Allow for multiple captions for each language

This may eventually be needed in future releases of PeerTube
This commit is contained in:
3risian 2020-01-09 12:41:44 +11:00 committed by GitHub
parent 66f07dcd41
commit b31f3dc2dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -497,9 +497,14 @@ class PeerTubeIE(InfoExtractor):
caption_path = entry.get('captionPath')
if language_id is not None and caption_path is not None:
caption_url = 'https://%s%s' % (host, caption_path)
subtitles[language_id] = [{
'url': caption_url
}]
if language_id in subtitles:
subtitles[language_id].append({
'url': caption_url
})
else:
subtitles[language_id] = [{
'url': caption_url
}]
return subtitles
def _real_extract(self, url):