{"record":{"id":"e65a5c23096efd4e","repo":"ytdl-org/youtube-dl","slug":"failure","errorCode":null,"errorMessage":"failure","messagePattern":"failure","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/piksel.py","lineNumber":83,"sourceCode":"        }\n    ]\n\n    @staticmethod\n    def _extract_url(webpage):\n        mobj = re.search(\n            r'<iframe[^>]+src=[\"\\'](?P<url>(?:https?:)?//player\\.piksel\\.com/v/[a-z0-9]+)',\n            webpage)\n        if mobj:\n            return mobj.group('url')\n\n    def _call_api(self, app_token, resource, display_id, query, fatal=True):\n        response = (self._download_json(\n            'http://player.piksel.com/ws/ws_%s/api/%s/mode/json/apiv/5' % (resource, app_token),\n            display_id, query=query, fatal=fatal) or {}).get('response')\n        failure = try_get(response, lambda x: x['failure']['reason'])\n        if failure:\n            if fatal:\n                raise ExtractorError(failure, expected=True)\n            self.report_warning(failure)\n        return response\n\n    def _real_extract(self, url):\n        ref_id, display_id = re.match(self._VALID_URL, url).groups()\n        webpage = self._download_webpage(url, display_id)\n        app_token = self._search_regex([\n            r'clientAPI\\s*:\\s*\"([^\"]+)\"',\n            r'data-de-api-key\\s*=\\s*\"([^\"]+)\"'\n        ], webpage, 'app token')\n        query = {'refid': ref_id, 'prefid': display_id} if ref_id else {'v': display_id}\n        program = self._call_api(\n            app_token, 'program', display_id, query)['WsProgramResponse']['program']\n        video_id = program['uuid']\n        video_data = program['asset']\n        title = video_data['title']\n        asset_type = dict_get(video_data, ['assetType', 'asset_type'])\n","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/piksel.py#L65-L101","documentation":"Raised by the Piksel _call_api helper when the ws_<resource> JSON response contains a response.failure.reason. With fatal=True (default) it becomes an expected ExtractorError whose message is the API's failure reason verbatim ('failure' in the catalog is the variable holding that reason); with fatal=False it degrades to a warning.","triggerScenarios":"Any Piksel player API call (ws_program/api/.../mode/json/apiv/5) whose response embeds {'failure': {'reason': ...}} — e.g. expired video, invalid app_token/refid combination, or media not entitled for the domain.","commonSituations":"Embedded Piksel players on news sites where the video expires or is region-locked; the page's clientAPI token being rotated so the scraped token no longer authorizes; refid/prefid mismatch after site redesigns.","solutions":["Open the embedding page in a browser to check the video still plays there","Update youtube-dl/yt-dlp in case the token-scraping regexes broke after a player update","If the reason text indicates geo/entitlement restrictions, access via the appropriate region or account"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept ExtractorError as e:\n    if e.expected:  # failure.reason from Piksel API\n        log.warning('Piksel said: %s', e)","preventionTips":["Check the embedding page still plays the video before extraction","Note the API's failure reason text — it names the real cause (expired/geo/token)","Keep the extractor version current for token-scraping fixes"],"tags":["piksel","api-error","embed","extractor-error","expected"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}