浏览代码

[theplatform] extract subtitles with multiple formats from the metadata

Remita Amine 9 年之前
父节点
当前提交
11f502fac1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      youtube_dl/extractor/theplatform.py

+ 2 - 2
youtube_dl/extractor/theplatform.py

@@ -73,10 +73,10 @@ class ThePlatformBaseIE(OnceIE):
         if isinstance(captions, list):
         if isinstance(captions, list):
             for caption in captions:
             for caption in captions:
                 lang, src, mime = caption.get('lang', 'en'), caption.get('src'), caption.get('type')
                 lang, src, mime = caption.get('lang', 'en'), caption.get('src'), caption.get('type')
-                subtitles[lang] = [{
+                subtitles.setdefault(lang, []).append({
                     'ext': mimetype2ext(mime),
                     'ext': mimetype2ext(mime),
                     'url': src,
                     'url': src,
-                }]
+                })
 
 
         return {
         return {
             'title': info['title'],
             'title': info['title'],