1
1
mirror of https://github.com/ytdl-org/youtube-dl synced 2024-11-24 15:46:51 +01:00

Merge remote-tracking branch 'anisse/fix-content-encoding-charset'

This commit is contained in:
Philipp Hagemeister 2014-04-07 23:27:03 +02:00
commit aafddb2b0a

View File

@ -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]):