Ver Fonte

Fixed issue #1277 KeyError when no description.

Allows a continue with a warning when an extractor cannot retrieve a description.
Jai Grimshaw há 12 anos atrás
pai
commit
b3f0e53048
1 ficheiros alterados com 2 adições e 0 exclusões
  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'Cannot extract description.')
             except (OSError, IOError):
                 self.report_error(u'Cannot write description file ' + descfn)
                 return