{"record":{"id":"0190de9ed2516778","repo":"ytdl-org/youtube-dl","slug":"this-video-is-not-available-in-your-region","errorCode":null,"errorMessage":"This video is not available in your region.","messagePattern":"This video is not available in your region\\.","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/viu.py","lineNumber":224,"sourceCode":"        country_code, video_id = re.match(self._VALID_URL, url).groups()\n\n        query = {\n            'r': 'vod/ajax-detail',\n            'platform_flag_label': 'web',\n            'product_id': video_id,\n        }\n\n        area_id = self._AREA_ID.get(country_code.upper())\n        if area_id:\n            query['area_id'] = area_id\n\n        product_data = self._download_json(\n            'http://www.viu.com/ott/%s/index.php' % country_code, video_id,\n            'Downloading video info', query=query)['data']\n\n        video_data = product_data.get('current_product')\n        if not video_data:\n            raise ExtractorError('This video is not available in your region.', expected=True)\n\n        stream_data = self._download_json(\n            'https://d1k2us671qcoau.cloudfront.net/distribute_web_%s.php' % country_code,\n            video_id, 'Downloading stream info', query={\n                'ccs_product_id': video_data['ccs_product_id'],\n            }, headers={\n                'Referer': url,\n                'Origin': re.search(r'https?://[^/]+', url).group(0),\n            })['data']['stream']\n\n        stream_sizes = stream_data.get('size', {})\n        formats = []\n        for vid_format, stream_url in stream_data.get('url', {}).items():\n            height = int_or_none(self._search_regex(\n                r's(\\d+)p', vid_format, 'height', default=None))\n            formats.append({\n                'format_id': vid_format,\n                'url': stream_url,","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/viu.py#L206-L242","documentation":"Thrown by the OTT-flavored Viu extractor when the country-specific index.php endpoint returns data lacking a 'current_product' entry for the requested video. The extractor maps the URL's country code to an area_id and expects product_data['current_product'] to exist; its absence means the title is unavailable for that market. Marked expected=True.","triggerScenarios":"Calling http://www.viu.com/ott/<country>/index.php with the video's query params from a region where the show is not distributed, so the returned data dict has no 'current_product' key.","commonSituations":"Extracting a drama URL with an unsupported market code (area_id lookup fails or the product simply isn't offered there); using a VPN exit country that differs from the URL's country segment.","solutions":["Use the URL for a country where the title is actually licensed (match the /<lang>/ or country segment of the URL)","Connect from an IP in that licensed market so the OTT endpoint returns the product","Verify the video ID exists on the viu.com website in that region first"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-check: is this market supported and product present?\nimport requests\nr = requests.get('http://www.viu.com/ott/%s/index.php' % country_code,\n                 params=query, timeout=10)\nif not r.json().get('data', {}).get('current_product'):\n    skip('Not available in region %s' % country_code)","typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'not available in your region' in str(e):\n        queue_for_proxy_retry(url)\n    else:\n        raise","preventionTips":["Match request IP country to the URL's market segment","Pre-filter video IDs against the OTT index endpoint before batch extraction","Keep a country_code -> area_id map consistent with ViuIE._AREA_ID"],"tags":["viu","geo-restriction","region-lock","ott"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}