From b31f3dc2dcc412dab8b5c21b64b6dbef0e51d38b Mon Sep 17 00:00:00 2001 From: 3risian <59593325+3risian@users.noreply.github.com> Date: Thu, 9 Jan 2020 12:41:44 +1100 Subject: [PATCH] Allow for multiple captions for each language This may eventually be needed in future releases of PeerTube --- youtube_dl/extractor/peertube.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/peertube.py b/youtube_dl/extractor/peertube.py index e4fc78695..e24b5c7fd 100644 --- a/youtube_dl/extractor/peertube.py +++ b/youtube_dl/extractor/peertube.py @@ -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):