[subtitles] Also list the available automatic captions languages with '--list-sub'
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 11 Sep 2013 17:17:30 +0000 (19:17 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 11 Sep 2013 17:17:30 +0000 (19:17 +0200)
youtube_dl/extractor/subtitles.py
youtube_dl/extractor/youtube.py

index a6780f1763440fe04a8ee135a07975da90bd6649..a956297650c4bbdef7e65cddcb2c8eea581eaa51 100644 (file)
@@ -8,12 +8,16 @@ from ..utils import (
 
 class SubtitlesInfoExtractor(InfoExtractor):
 
-    def _list_available_subtitles(self, video_id):
+    def _list_available_subtitles(self, video_id, webpage=None):
         """ outputs the available subtitles for the video """
         sub_lang_list = self._get_available_subtitles(video_id)
+        auto_captions_list = self._get_available_automatic_caption(video_id, webpage)
         sub_lang = ",".join(list(sub_lang_list.keys()))
         self.to_screen(u'%s: Available subtitles for video: %s' %
                        (video_id, sub_lang))
+        auto_lang = ",".join(auto_captions_list.keys())
+        self.to_screen(u'%s: Available automatic captions for video: %s' %
+                       (video_id, auto_lang))
 
     def extract_subtitles(self, video_id, video_webpage=None):
         """ returns {sub_lang: sub} or {} if subtitles not found """
index 46f977ce7e659d9f4f22e2c1b2dff81fcc3b22ab..331fd143a6ecc4909924799471132b7cfe3913c4 100644 (file)
@@ -724,7 +724,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
         video_subtitles = self.extract_subtitles(video_id, video_webpage)
 
         if self._downloader.params.get('listsubtitles', False):
-            self._list_available_subtitles(video_id)
+            self._list_available_subtitles(video_id, video_webpage)
             return
 
         if 'length_seconds' not in video_info: