aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-04-07 23:27:03 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-04-07 23:27:03 +0200
commitaafddb2b0a0c6493e5c1e9f92c1570d3c018845b (patch)
treec5212c162ead1bb423a94bc19f3eda564b0fd9d7 /youtube_dl
parent6262ac8ac56d92a156fc61cd3cc6135d0d304488 (diff)
parentec0fafbb1915b830035f621f4660c7e46b1a53ed (diff)
Merge remote-tracking branch 'anisse/fix-content-encoding-charset'
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/common.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py
index da4193734..9653d44eb 100644
--- 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]):