mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-03 21:07:06 -05:00 
			
		
		
		
	[extractor/common] fallback on utf-8 when charset is not found
fixes #2721
This commit is contained in:
		@@ -251,7 +251,10 @@ class InfoExtractor(object):
 | 
			
		||||
            with open(filename, 'wb') as outf:
 | 
			
		||||
                outf.write(webpage_bytes)
 | 
			
		||||
 | 
			
		||||
        content = webpage_bytes.decode(encoding, 'replace')
 | 
			
		||||
        try:
 | 
			
		||||
            content = webpage_bytes.decode(encoding, 'replace')
 | 
			
		||||
        except LookupError:
 | 
			
		||||
            content = webpage_bytes.decode('utf-8', 'replace')
 | 
			
		||||
 | 
			
		||||
        if (u'<title>Access to this site is blocked</title>' in content and
 | 
			
		||||
                u'Websense' in content[:512]):
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user