{"record":{"id":"cacdd14133cc3ede","repo":"ytdl-org/youtube-dl","slug":"message-cacdd1","errorCode":null,"errorMessage":"message","messagePattern":"message","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/hotstar.py","lineNumber":66,"sourceCode":"        if response['statusCode'] != 'OK':\n            raise ExtractorError(\n                response['body']['message'], expected=True)\n        return response['body']['results']\n\n    def _call_api_v2(self, path, video_id, headers, query=None, data=None):\n        h = {'X-Request-Id': compat_str(uuid.uuid4())}\n        h.update(headers)\n        try:\n            return self._call_api_impl(\n                path, video_id, h, query, data)\n        except ExtractorError as e:\n            if isinstance(e.cause, compat_HTTPError):\n                if e.cause.code == 402:\n                    self.raise_login_required()\n                message = self._parse_json(e.cause.read().decode(), video_id)['message']\n                if message in ('Content not available in region', 'Country is not supported'):\n                    raise self.raise_geo_restricted(message)\n                raise ExtractorError(message)\n            raise e\n\n\nclass HotStarIE(HotStarBaseIE):\n    IE_NAME = 'hotstar'\n    _VALID_URL = r'https?://(?:www\\.)?hotstar\\.com/(?:.+[/-])?(?P<id>\\d{10})'\n    _TESTS = [{\n        # contentData\n        'url': 'https://www.hotstar.com/can-you-not-spread-rumours/1000076273',\n        'info_dict': {\n            'id': '1000076273',\n            'ext': 'mp4',\n            'title': 'Can You Not Spread Rumours?',\n            'description': 'md5:c957d8868e9bc793ccb813691cc4c434',\n            'timestamp': 1447248600,\n            'upload_date': '20151111',\n            'duration': 381,\n        },","sourceCodeStart":48,"sourceCodeEnd":84,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/hotstar.py#L48-L84","documentation":"Raised by the Hotstar extractor when a call to Hotstar's API fails with an HTTP error whose JSON body contains a 'message' field, and that message is neither 'Content not available in region' / 'Country is not supported' (which become geo-restricted errors) nor a 402 (which triggers a login-required error). The raw server message is re-packed into a generic ExtractorError and shown to the user.","triggerScenarios":"Any _call_api_impl request (e.g. 'um/v3/users' token creation, or content metadata 'o/v1/...' paths) that returns a non-2xx HTTP status with a JSON body whose 'message' is something other than the two known geo strings; e.g. 'Content is private', expired content IDs, or 'USER_TOKEN expired' style API errors.","commonSituations":"Removed/expired Hotstar content, premium content that needs a subscription cookie, API schema changes on Hotstar's side after the extractor was written, or regional CDN responses the extractor does not recognize.","solutions":["Verify the Hotstar URL is still valid and the content is not expired or members-only (open it in a browser).","Update to the latest youtube-dl / yt-dlp, since Hotstar's API changes frequently and the extractor is patched often.","For premium content, supply credentials via the extractor's supported login mechanism so the 402 path can obtain a token.","If the message indicates geo blocking in new wording, access via an allowed region and retry."],"exampleFix":"// before\nyoutube_dl 'https://www.hotstar.com/some-show/1000076273'\n# => ExtractorError: <server message>\n\n// after\n# confirm the URL in a browser; if it 404s or is DRM/paywalled, use a valid free URL\nyoutube_dl 'https://www.hotstar.com/can-you-not-spread-rumours/1000076273'","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"from youtube_dl.utils import ExtractorError\ntry:\n    ydl.extract_info('https://www.hotstar.com/-/1000076273', download=False)\nexcept ExtractorError as e:\n    # server message is in str(e); treat non-geo API failures as fatal-for-this-url\n    log.warning('hotstar rejected: %s', e)","preventionTips":["Validate Hotstar URLs contain a 10-digit content ID matching _VALID_URL before extraction.","Keep youtube-dl/yt-dlp current; Hotstar API errors change wording frequently.","Handle the geo-restricted and login-required subtypes distinctly from generic messages."],"tags":["api","http","extractor","streaming","hotstar"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}