commit aafddb2b0a0c6493e5c1e9f92c1570d3c018845b
parent 6262ac8ac56d92a156fc61cd3cc6135d0d304488
Author: Philipp Hagemeister <phihag@phihag.de>
Date: Mon, 7 Apr 2014 23:27:03 +0200
Merge remote-tracking branch 'anisse/fix-content-encoding-charset'
Diffstat:
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
@@ -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]):