From 9e91449c8d1dae53eda6fb250384f0afa5122ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Thu, 5 Feb 2015 20:13:28 +0600 Subject: [PATCH] [npo] Fix subtitles (Closes #3638) --- youtube_dl/extractor/npo.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/npo.py b/youtube_dl/extractor/npo.py index 0580461bb..54be06a4e 100644 --- a/youtube_dl/extractor/npo.py +++ b/youtube_dl/extractor/npo.py @@ -159,15 +159,18 @@ def _get_info(self, video_id): 'quality': stream.get('kwaliteit'), }) - subtitles = {} - - tt888 = metadata.get('tt888') - if self._have_to_download_any_subtitles and tt888 == 'ja': - subtitles['nl'] = 'http://e.omroep.nl/tt888/%s' % video_id - subtitles = self.extract_subtitles(video_id, subtitles) - self._sort_formats(formats) + subtitles = {} + if metadata.get('tt888') == 'ja': + subtitles['nl'] = 'http://e.omroep.nl/tt888/%s' % video_id + + if self._downloader.params.get('listsubtitles', False): + self._list_available_subtitles(video_id, subtitles) + return + + subtitles = self.extract_subtitles(video_id, subtitles) + return { 'id': video_id, 'title': metadata['titel'],