mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	Fixed issue #1277 KeyError when no description.
Allows a continue with a warning when an extractor cannot retrieve a description.
This commit is contained in:
		@@ -492,6 +492,8 @@ class YoutubeDL(object):
 | 
				
			|||||||
                self.report_writedescription(descfn)
 | 
					                self.report_writedescription(descfn)
 | 
				
			||||||
                with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
 | 
					                with io.open(encodeFilename(descfn), 'w', encoding='utf-8') as descfile:
 | 
				
			||||||
                    descfile.write(info_dict['description'])
 | 
					                    descfile.write(info_dict['description'])
 | 
				
			||||||
 | 
					            except (KeyError, TypeError):
 | 
				
			||||||
 | 
					                self.report_warning(u'Cannot extract description.')
 | 
				
			||||||
            except (OSError, IOError):
 | 
					            except (OSError, IOError):
 | 
				
			||||||
                self.report_error(u'Cannot write description file ' + descfn)
 | 
					                self.report_error(u'Cannot write description file ' + descfn)
 | 
				
			||||||
                return
 | 
					                return
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user