X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fcommon.py;h=ef02b68966e88d8d1cbc2f9d628e5a79fe8ce3c3;hb=4f3e943080f3381213ee979647f68eee43af4bb8;hp=78f238f8428c5df0fce2dcc26f66b1301595e62b;hpb=38d63d846edbf4c897a7df6e2ee545002e1203ca;p=youtube-dl diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 78f238f84..ef02b6896 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -251,7 +251,21 @@ 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'Access to this site is blocked' in content and + u'Websense' in content[:512]): + msg = u'Access to this webpage has been blocked by Websense filtering software in your network.' + blocked_iframe = self._html_search_regex( + r'