{"record":{"id":"becc7704f2bbf9e5","repo":"ytdl-org/youtube-dl","slug":"s-said-s-becc77","errorCode":null,"errorMessage":"%s said: %s","messagePattern":"%s said: %s","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/viu.py","lineNumber":45,"sourceCode":"                'platform': 'desktop',\n                'userid': 'guest',\n                'useridtype': 'guest',\n                'ver': '1.0'\n            }, headers=self.geo_verification_headers())\n        self._auth_token = viu_auth_res.info()['X-VIU-AUTH']\n\n    def _call_api(self, path, *args, **kwargs):\n        headers = self.geo_verification_headers()\n        headers.update({\n            'X-VIU-AUTH': self._auth_token\n        })\n        headers.update(kwargs.get('headers', {}))\n        kwargs['headers'] = headers\n        response = self._download_json(\n            'https://www.viu.com/api/' + path, *args,\n            **compat_kwargs(kwargs))['response']\n        if response.get('status') != 'success':\n            raise ExtractorError('%s said: %s' % (\n                self.IE_NAME, response['message']), expected=True)\n        return response\n\n\nclass ViuIE(ViuBaseIE):\n    _VALID_URL = r'(?:viu:|https?://[^/]+\\.viu\\.com/[a-z]{2}/media/)(?P<id>\\d+)'\n    _TESTS = [{\n        'url': 'https://www.viu.com/en/media/1116705532?containerId=playlist-22168059',\n        'info_dict': {\n            'id': '1116705532',\n            'ext': 'mp4',\n            'title': 'Citizen Khan - Ep 1',\n            'description': 'md5:d7ea1604f49e5ba79c212c551ce2110e',\n        },\n        'params': {\n            'skip_download': 'm3u8 download',\n        },\n        'skip': 'Geo-restricted to India',","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/viu.py#L27-L63","documentation":"Generic API-failure error raised by ViuBaseIE._call_api when a request to https://www.viu.com/api/<path> succeeds at the HTTP level but the JSON response's response.status field is not 'success'. The message interpolates the IE name and the server-provided response.message, so the exact text varies. Expected=True keeps it a user-visible extraction error.","triggerScenarios":"Any _download_json call to viu.com/api/* (e.g. playlist or media endpoints) whose parsed ['response']['status'] != 'success'; typical causes are invalid/expired X-VIU-AUTH tokens, bad parameters, or region-locked content.","commonSituations":"Expired or missing VIU auth token; requesting content not licensed for the requesting country; upstream API schema changes after a site redesign.","solutions":["Read the interpolated server message — it is the actual API explanation (e.g. token invalid, geo-blocked)","Refresh any authentication cookies/tokens used to build X-VIU-AUTH before extraction","Route the request through a region where the content is available (the API is geo-sensitive via geo_verification_headers)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    info = ydl.extract_info(viu_url)\nexcept ExtractorError as e:\n    msg = str(e)\n    if 'geo' in msg.lower():\n        log('region-locked, skipping')\n    elif 'token' in msg.lower():\n        refresh_viu_token(); retry = True\n    else:\n        raise","preventionTips":["Refresh the X-VIU-AUTH token before each batch run","Log the interpolated server message — it distinguishes auth vs geo failures","Mark failing IDs and back off instead of re-hitting the API"],"tags":["viu","api","auth-token","geo"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}