瀏覽代碼

[limelight] Extract ttml subtitles (Closes #9739)

Sergey M․ 9 年之前
父節點
當前提交
fe458b6596
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      youtube_dl/extractor/limelight.py

+ 8 - 2
youtube_dl/extractor/limelight.py

@@ -102,9 +102,15 @@ class LimelightBaseIE(InfoExtractor):
             lang = caption.get('language_code')
             lang = caption.get('language_code')
             subtitles_url = caption.get('url')
             subtitles_url = caption.get('url')
             if lang and subtitles_url:
             if lang and subtitles_url:
-                subtitles[lang] = [{
+                subtitles.setdefault(lang, []).append({
                     'url': subtitles_url,
                     'url': subtitles_url,
-                }]
+                })
+        closed_captions_url = properties.get('closed_captions_url')
+        if closed_captions_url:
+            subtitles.setdefault('en', []).append({
+                'url': closed_captions_url,
+                'ext': 'ttml',
+            })
 
 
         return {
         return {
             'id': video_id,
             'id': video_id,