aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-09-11 19:17:30 +0200
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-09-11 19:17:30 +0200
commitd665f8d3cbb3ff507a76421e66fa96f55a830c08 (patch)
treed5617d9e3f30632f37e466d4dca277f484c1cd4b /youtube_dl/extractor
parent055e6f36577497d807d4f474db2489f2e0ef1d4e (diff)
[subtitles] Also list the available automatic captions languages with '--list-sub'
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/subtitles.py6
-rw-r--r--youtube_dl/extractor/youtube.py2
2 files changed, 6 insertions, 2 deletions
diff --git a/youtube_dl/extractor/subtitles.py b/youtube_dl/extractor/subtitles.py
index a6780f176..a95629765 100644
--- a/youtube_dl/extractor/subtitles.py
+++ b/youtube_dl/extractor/subtitles.py
@@ -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 """
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 46f977ce7..331fd143a 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -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: