Merge pull request #1350 from Jaiz909/description-keyerror-fix
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 13 Sep 2013 16:20:09 +0000 (18:20 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 13 Sep 2013 16:20:42 +0000 (18:20 +0200)
Fixed issue #1277 KeyError when no description.

youtube_dl/YoutubeDL.py

index b289bd9e26bbc9993e6f1295a31d20b3275f5f48..c2f992b8e00f333f59da38ffd59153183d057281 100644 (file)
@@ -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