From 628292ebb1d150c1b9da7e3557355daa642c092b Mon Sep 17 00:00:00 2001 From: Teemu Ikonen Date: Mon, 20 Jul 2020 22:59:04 +0300 Subject: [PATCH] [yle-dl] Support multiple subs per language --- youtube_dl/extractor/yledl.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/yledl.py b/youtube_dl/extractor/yledl.py index e19e105e8..51749c1a7 100644 --- a/youtube_dl/extractor/yledl.py +++ b/youtube_dl/extractor/yledl.py @@ -1,5 +1,6 @@ # coding: utf-8 from __future__ import unicode_literals +from collections import defaultdict import subprocess import json @@ -50,9 +51,9 @@ class YleDLIE(InfoExtractor): props['description'] = description ysubs = yledl.get('subtitles', []) - subtitles = {} + subtitles = defaultdict(list) for s in ysubs: - subtitles[s['language']] = [{'url': s['url']}] + subtitles[s['language']].append({'url': s['url'], 'ext': s['category']}) props['subtitles'] = subtitles formats = []