{"record":{"id":"b710b518f7cb5709","repo":"ytdl-org/youtube-dl","slug":"letv-cloud-returned-an-unknown-error","errorCode":null,"errorMessage":"Letv cloud returned an unknown error","messagePattern":"Letv cloud returned an unknown error","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/leeco.py","lineNumber":329,"sourceCode":"                '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')),\n            })\n","sourceCodeStart":311,"sourceCodeEnd":347,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/leeco.py#L311-L347","documentation":"Raised by the Letv Cloud extractor when the gpc.php playJson response has neither 'data', nor 'message', nor a usable 'code' — a completely unrecognized error shape. It is expected=True but signals the extractor cannot interpret the API response at all, which often means an API contract change rather than a content problem.","triggerScenarios":"Letv Cloud extraction where gpc.php returns JSON with none of the expected keys (for example an HTML error page parsed as JSON, an empty object, or a new response schema after an API update).","commonSituations":"Letv Cloud API endpoints being deprecated or restructured; CDN edge responses (maintenance/captcha pages) returned instead of JSON; very old youtube-dl versions against a changed API; network middleboxes mangling responses.","solutions":["Update youtube-dl / switch to yt-dlp — unknown-shape responses usually mean an API change already fixed upstream","Fetch the gpc.php URL manually with the same uu/vu to inspect what is actually returned","If the service is dead in your region or entirely, use an alternative source for the content","Report the response body upstream so the extractor can be taught the new shape"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import json, urllib.request\n\ndef letv_api_returns_json(uu, vu):\n    # smoke-test the gpc.php endpoint shape before running the extractor\n    url = 'http://api.letvcloud.com/gpc.php?uu=%s&vu=%s&cf=flash' % (uu, vu)\n    try:\n        json.load(urllib.request.urlopen(url, timeout=10))\n        return True\n    except (ValueError, urllib.error.URLError):\n        return False","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'unknown error' in str(e):\n        update_extractor_or_switch_to_ytdlp()  # response shape changed upstream\n    else:\n        raise","preventionTips":["Smoke-test the API endpoint shape before batch runs","Prefer yt-dlp, which tracks API changes faster for niche extractors"],"tags":["letv-cloud","api-change","unknown-error","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}