A feature-rich command-line audio/video downloader
[extractor/common] Recognize Indian censorship (#5021)
Philipp Hagemeister77b2986b5b02
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.pyindex 08b8ad37c4..ee64ad329d 100644--- a/youtube_dl/extractor/common.py+++ b/youtube_dl/extractor/common.py@@ -391,6 +391,16 @@ class InfoExtractor(object):if blocked_iframe:msg += ' Visit %s for more details' % blocked_iframeraise ExtractorError(msg, expected=True)+ if '<title>The URL you requested has been blocked</title>' in content[:512]:+ msg = (+ 'Access to this webpage has been blocked by Indian censorship. '+ 'Use a VPN or proxy server (with --proxy) to route around it.')+ block_msg = self._html_search_regex(+ r'</h1><p>(.*?)</p>',+ content, 'block message', default=None)+ if block_msg:+ msg += ' (Message: "%s")' % block_msg.replace('\n', ' ')+ raise ExtractorError(msg, expected=True)return content