ytdl-org/youtube-dl · error · ExtractorError
Letv cloud returned error %d
Error message
Letv cloud returned error %d
What it means
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.
Source
Thrown at youtube_dl/extractor/leeco.py:327
'uu': uu,
'vu': vu,
'ran': compat_str(timestamp),
}
self.sign_data(data)
return self._download_json(
'http://api.letvcloud.com/gpc.php?' + compat_urllib_parse_urlencode(data),
media_id, 'Downloading playJson data for type %s' % cf)
play_json = get_play_json(cf, time.time())
# The server time may be different from local time
if play_json.get('code') == 10071:
play_json = get_play_json(cf, play_json['timestamp'])
if not play_json.get('data'):
if play_json.get('message'):
raise ExtractorError('Letv cloud said: %s' % play_json['message'], expected=True)
elif play_json.get('code'):
raise ExtractorError('Letv cloud returned error %d' % play_json['code'], expected=True)
else:
raise ExtractorError('Letv cloud returned an unknown error')
def b64decode(s):
return compat_b64decode(s).decode('utf-8')
formats = []
for media in play_json['data']['video_info']['media'].values():
play_url = media['play_url']
url = b64decode(play_url['main_url'])
decoded_url = b64decode(url_basename(url))
formats.append({
'url': url,
'ext': determine_ext(decoded_url),
'format_id': str_or_none(play_url.get('vtype')),
'format_note': str_or_none(play_url.get('definition')),
'width': int_or_none(play_url.get('vwidth')),
'height': int_or_none(play_url.get('vheight')),View on GitHub (pinned to 956b8c5855)
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
Defensive patterns
Strategy: try-catch
Try / catch
try:
ydl.extract_info(url)
except ExtractorError as e:
if 'Letv cloud returned error' in str(e):
code = int(str(e).rsplit(' ', 1)[1])
if code_refers_to_referer(code):
retry_with_referer(url, parent_page_url)
else:
raise Prevention
- Forward the embedding page as Referer when downloading Letv Cloud embeds
- Keep a mapping of known Letv Cloud codes to causes for automated triage
When it happens
Trigger: 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.
Common situations: 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.
Related errors
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/ed3f99dfb6c4a612.
Report an issue: GitHub.