Don't try to write the subtitles if it's None
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 20 Jul 2013 10:59:47 +0000 (12:59 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 20 Jul 2013 10:59:47 +0000 (12:59 +0200)
youtube_dl/YoutubeDL.py

index be6ceafcc3b5844906ddeeee76eaeefd0524f0ad..e69d844b8a6c47188cb3a26cbdb63b004c770828 100644 (file)
@@ -494,6 +494,8 @@ class YoutubeDL(object):
             sub_format = self.params.get('subtitlesformat')
             for sub_lang in subtitles.keys():
                 sub = subtitles[sub_lang]
+                if sub is None:
+                    continue
                 try:
                     sub_filename = filename.rsplit('.', 1)[0] + u'.' + sub_lang + u'.' + sub_format
                     self.report_writesubtitles(sub_filename)