{"record":{"id":"ed3f99dfb6c4a612","repo":"ytdl-org/youtube-dl","slug":"letv-cloud-returned-error-d","errorCode":null,"errorMessage":"Letv cloud returned error %d","messagePattern":"Letv cloud returned error (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/leeco.py","lineNumber":327,"sourceCode":"                'uu': uu,\n                'vu': vu,\n                'ran': compat_str(timestamp),\n            }\n            self.sign_data(data)\n            return self._download_json(\n                'http://api.letvcloud.com/gpc.php?' + compat_urllib_parse_urlencode(data),\n                media_id, 'Downloading playJson data for type %s' % cf)\n\n        play_json = get_play_json(cf, time.time())\n        # The server time may be different from local time\n        if play_json.get('code') == 10071:\n            play_json = get_play_json(cf, play_json['timestamp'])\n\n        if not play_json.get('data'):\n            if play_json.get('message'):\n                raise ExtractorError('Letv cloud said: %s' % play_json['message'], expected=True)\n            elif play_json.get('code'):\n                raise ExtractorError('Letv cloud returned error %d' % play_json['code'], expected=True)\n            else:\n                raise ExtractorError('Letv cloud returned an unknown error')\n\n        def b64decode(s):\n            return compat_b64decode(s).decode('utf-8')\n\n        formats = []\n        for media in play_json['data']['video_info']['media'].values():\n            play_url = media['play_url']\n            url = b64decode(play_url['main_url'])\n            decoded_url = b64decode(url_basename(url))\n            formats.append({\n                'url': url,\n                'ext': determine_ext(decoded_url),\n                'format_id': str_or_none(play_url.get('vtype')),\n                'format_note': str_or_none(play_url.get('definition')),\n                'width': int_or_none(play_url.get('vwidth')),\n                'height': int_or_none(play_url.get('vheight')),","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/leeco.py#L309-L345","documentation":"Raised by the Letv Cloud extractor when the gpc.php playJson response lacks 'data' and lacks 'message' but has a non-zero numeric 'code'. The numeric code is included in the message. It is expected=True and represents Letv Cloud error codes the extractor cannot map to text.","triggerScenarios":"Letv Cloud extraction (uu=/vu= URL) where the API returns an error code with no human message — e.g. invalid signature, disallowed referer, or deleted resource — after the 10071 timestamp-retry path.","commonSituations":"Referer-protected embeds requested without the embedding page's context; partially copied uu/vu values; API behavior changes introducing new codes; automated bulk downloads tripping Letv Cloud rate/permission codes.","solutions":["Look up the numeric code in Letv Cloud API docs (commonly signature/referer issues) and fix the request context accordingly","Supply the embedding page as referer (some youtube-dl versions forward referer for embeds; otherwise use yt-dlp with --add-headers)","Verify uu/vu were copied intact from the working embed code","Update to yt-dlp if Letv Cloud handling improved"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Letv cloud returned error' in str(e):\n        code = int(str(e).rsplit(' ', 1)[1])\n        if code_refers_to_referer(code):\n            retry_with_referer(url, parent_page_url)\n    else:\n        raise","preventionTips":["Forward the embedding page as Referer when downloading Letv Cloud embeds","Keep a mapping of known Letv Cloud codes to causes for automated triage"],"tags":["letv-cloud","api-error","error-code","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}