]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[npo] Fix subtitles (Closes #3638)
authorSergey M․ <dstftw@gmail.com>
Thu, 5 Feb 2015 14:13:28 +0000 (20:13 +0600)
committerSergey M․ <dstftw@gmail.com>
Thu, 5 Feb 2015 14:13:28 +0000 (20:13 +0600)
youtube_dl/extractor/npo.py

index 0580461bbc65dffd61420f861173f1334c3ef197..54be06a4edc375f736cc038961eac67e73eecf85 100644 (file)
@@ -159,14 +159,17 @@ class NPOIE(NPOBaseIE):
                     'quality': stream.get('kwaliteit'),
                 })
 
-        subtitles = {}
+        self._sort_formats(formats)
 
-        tt888 = metadata.get('tt888')
-        if self._have_to_download_any_subtitles and tt888 == 'ja':
+        subtitles = {}
+        if metadata.get('tt888') == 'ja':
             subtitles['nl'] = 'http://e.omroep.nl/tt888/%s' % video_id
-            subtitles = self.extract_subtitles(video_id, subtitles)
 
-        self._sort_formats(formats)
+        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,