Browse Source

Don't try to write the subtitles if it's None

Jaime Marquínez Ferrándiz 12 năm trước cách đây
mục cha
commit
6804038d06
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      youtube_dl/YoutubeDL.py

+ 2 - 0
youtube_dl/YoutubeDL.py

@@ -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)