瀏覽代碼

Merge pull request #1350 from Jaiz909/description-keyerror-fix

Fixed issue #1277 KeyError when no description.
Jaime Marquínez Ferrándiz 12 年之前
父節點
當前提交
535f59bbcf
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      youtube_dl/YoutubeDL.py

+ 2 - 0
youtube_dl/YoutubeDL.py

@@ -492,6 +492,8 @@ class YoutubeDL(object):
                 self.report_writedescription(descfn)
                 with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
                     descfile.write(info_dict['description'])
+            except (KeyError, TypeError):
+                self.report_warning(u'There\'s no description to write.')
             except (OSError, IOError):
                 self.report_error(u'Cannot write description file ' + descfn)
                 return