{"record":{"id":"c172ec7b700424d8","repo":"ytdl-org/youtube-dl","slug":"access-to-this-webpage-has-been-blocked-by-websens","errorCode":null,"errorMessage":"Access to this webpage has been blocked by Websense filtering software in your network. Visit %s for more details","messagePattern":"Access to this webpage has been blocked by Websense filtering software in your network\\. Visit (.+?) for more details","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/common.py","lineNumber":749,"sourceCode":"                encoding = m.group(1).decode('ascii')\n            elif webpage_bytes.startswith(b'\\xff\\xfe'):\n                encoding = 'utf-16'\n            else:\n                encoding = 'utf-8'\n\n        return encoding\n\n    def __check_blocked(self, content):\n        first_block = content[:512]\n        if ('<title>Access to this site is blocked</title>' in content\n                and 'Websense' in first_block):\n            msg = 'Access to this webpage has been blocked by Websense filtering software in your network.'\n            blocked_iframe = self._html_search_regex(\n                r'<iframe src=\"([^\"]+)\"', content,\n                'Websense information URL', default=None)\n            if blocked_iframe:\n                msg += ' Visit %s for more details' % blocked_iframe\n            raise ExtractorError(msg, expected=True)\n        if '<title>The URL you requested has been blocked</title>' in first_block:\n            msg = (\n                'Access to this webpage has been blocked by Indian censorship. '\n                'Use a VPN or proxy server (with --proxy) to route around it.')\n            block_msg = self._html_search_regex(\n                r'</h1><p>(.*?)</p>',\n                content, 'block message', default=None)\n            if block_msg:\n                msg += ' (Message: \"%s\")' % block_msg.replace('\\n', ' ')\n            raise ExtractorError(msg, expected=True)\n        if ('<title>TTK :: Доступ к ресурсу ограничен</title>' in content\n                and 'blocklist.rkn.gov.ru' in content):\n            raise ExtractorError(\n                'Access to this webpage has been blocked by decision of the Russian government. '\n                'Visit http://blocklist.rkn.gov.ru/ for a block reason.',\n                expected=True)\n\n    def _webpage_read_content(self, urlh, url_or_request, video_id, note=None, errnote=None, fatal=True, prefix=None, encoding=None):","sourceCodeStart":731,"sourceCodeEnd":767,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/common.py#L731-L767","documentation":"Raised by the internal __check_blocked heuristic that runs on every downloaded webpage: if the first 512 bytes contain the '<title>Access to this site is blocked</title>' marker together with 'Websense', the response came from Websense corporate filtering, not the target site. youtube-dl surfaces this as an expected error, appending the vendor's information iframe URL when present.","triggerScenarios":"Running youtube-dl behind a corporate/school network whose Websense appliance intercepts HTTP and returns its block page. The '%s' in the message is the iframe URL from the block page with details of the filtering policy.","commonSituations":"Office, school, or public networks with forcepoint/trend-micro-class web filtering; HTTP (not HTTPS) requests being intercepted and rewritten to the block page.","solutions":["Use a different network (mobile hotspot, home connection) or a VPN outside the filtered network.","Ask the network administrator to allow the target domain.","Visit the URL printed in the error to see the filter's explanation/category.","Prefer HTTPS URLs where possible — many filters only inject block pages into plain HTTP."],"exampleFix":"# before\nydl.extract('http://example.com/video')  # behind Websense corporate proxy\n\n# after: force https / bypass filter\nydl.extract('https://example.com/video')","handlingStrategy":"validation","validationCode":"def looks_like_websense_block(html):\n    head = html[:512]\n    return '<title>Access to this site is blocked</title>' in html and 'Websense' in head","typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Websense' in str(e):\n        reroute_via_unfiltered_network(url)  # hotspot/VPN; retrying here is useless\n    else:\n        raise","preventionTips":["Detect filter block pages early (title + vendor marker) and reroute.","Use HTTPS targets so filtering appliances cannot inject block pages.","Do not retry filtered requests on the same network; switch networks."],"tags":["censorship","corporate-proxy","websense","network"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}