{"record":{"id":"b31d4ffbf4f61075","repo":"ytdl-org/youtube-dl","slug":"s-returned-error-s-b31d4f","errorCode":null,"errorMessage":"%s returned error: %s","messagePattern":"(.+?) returned error: (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/shahid.py","lineNumber":146,"sourceCode":"        self._sort_formats(formats)\n\n        # video = self._call_api(\n        #     'product/id', video_id, {\n        #         'id': video_id,\n        #         'productType': 'ASSET',\n        #         'productSubType': page_type.upper()\n        #     })['productModel']\n\n        response = self._download_json(\n            'http://api.shahid.net/api/v1_1/%s/%s' % (page_type, video_id),\n            video_id, 'Downloading video JSON', query={\n                'apiKey': 'sh@hid0nlin3',\n                'hash': 'b2wMCTHpSmyxGqQjJFOycRmLSex+BpTK/ooxy6vHaqs=',\n            })\n        data = response.get('data', {})\n        error = data.get('error')\n        if error:\n            raise ExtractorError(\n                '%s returned error: %s' % (self.IE_NAME, '\\n'.join(error.values())),\n                expected=True)\n\n        video = data[page_type]\n        title = video['title']\n        categories = [\n            category['name']\n            for category in video.get('genres', []) if 'name' in category]\n\n        return {\n            'id': video_id,\n            'title': title,\n            'description': video.get('description'),\n            'thumbnail': video.get('thumbnailUrl'),\n            'duration': int_or_none(video.get('duration')),\n            'timestamp': parse_iso8601(video.get('referenceDate')),\n            'categories': categories,\n            'series': video.get('showTitle') or video.get('showName'),","sourceCodeStart":128,"sourceCodeEnd":164,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/shahid.py#L128-L164","documentation":"Raised by ShahidIE._real_extract when the legacy v1_1 API (api.shahid.net/api/v1_1/<type>/<id>) returns a data payload containing an 'error' dict. All error values (typically message strings per error key) are newline-joined into one message prefixed with the extractor name. Expected=True, so it represents a server-reported content error such as 'not found' or 'not available in your region'.","triggerScenarios":"Downloading the v1_1 video JSON with the hard-coded apiKey/hash query and receiving {'data': {'error': {...}}} - e.g. a deleted show/episode, an invalid or truncated video id, or a region-locked asset.","commonSituations":"Following dead/deprecated Shahid links whose playout succeeded but metadata 404s; URL typos after the last path segment; MBC regional licensing making an asset error out outside the licensed region; the v1_1 endpoint itself being retired in favor of the AWS proxy API.","solutions":["Verify the Shahid URL opens in a browser and note any 'content unavailable' notice.","Search Shahid for the same title to get the current canonical episode URL (ids change when shows are re-listed).","If region-locked, use a VPN matching the licensed region.","Update youtube-dl/yt-dlp - newer versions drop the v1_1 call entirely and rely on the proxy API, avoiding this path."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    extract(url)\nexcept ExtractorError as e:\n    if e.expected and str(e).startswith('Shahid'):\n        record_dead_link(url, str(e))\n    else:\n        raise","preventionTips":["Validate Shahad links resolve in a HEAD/browser check before large batches.","Keep extractor current; the v1_1 endpoint is legacy.","Log server messages - they distinguish region vs deletion."],"tags":["shahid","api-error","dead-link","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}