soimort/you-get · error · ValueError
Cannot_Get_Play_URL
Error message
Cannot_Get_Play_URL
What it means
Raised as ValueError in interest_download (src/you_get/extractors/interest.py:18) from the KeyError handler. After loading the play-info JSON from the data URL scraped off the page, the expected key path data['data']['cdn']['serverurl'] is missing, so no RTMP play URL can be obtained.
Source
Thrown at src/you_get/extractors/interest.py:18
#!/usr/bin/env python
from ..common import *
from json import loads
def interest_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
#http://ch.interest.me/zhtv/VOD/View/114789
#http://program.interest.me/zhtv/sonja/8/Vod/View/15794
html = get_content(url)
#get title
title = match1(html, r'<meta property="og:title" content="([^"]*)"')
title = title.split('&')[0].strip()
info_url = match1(html, r'data: "(.+)",')
play_info = loads(get_content(info_url))
try:
serverurl = play_info['data']['cdn']['serverurl']
except KeyError:
raise ValueError('Cannot_Get_Play_URL')
except:
raise ValueError('Cannot_Get_Play_URL')
# I cannot find any example of "fileurl", so i just put it like this for now
assert serverurl
type, ext, size = 'mp4', 'mp4', 0
print_info(site_info, title, type, size)
if not info_only:
download_rtmp_url(url=serverurl, title=title, ext=ext, output_dir=output_dir)
site_info = "interest.me"
download = interest_download
download_playlist = playlist_not_supported('interest')
View on GitHub (pinned to 049548f3f3)
Solutions
- Log play_info (the parsed JSON) to see which keys are actually present for your URL.
- Try a different episode/URL to distinguish content-specific restriction from a schema change.
- If the schema moved, update the key path in interest_download or upgrade you-get.
Defensive patterns
Strategy: validation
Validate before calling
def interest_play_info_has_serverurl(play_info):
if not isinstance(play_info, dict):
return False
data = play_info.get('data')
cdn = data.get('cdn') if isinstance(data, dict) else None
return isinstance(cdn, dict) and bool(cdn.get('serverurl')) Try / catch
try:
interest_download(url, output_dir)
except ValueError as e:
if str(e) == 'Cannot_Get_Play_URL':
log_play_info_json(url) # inspect schema before deciding retry vs fix
else:
raise Prevention
- Validate the JSON key path data.cdn.serverurl exists before handing off to the downloader.
- Treat missing cdn info as content unavailability (geo/DRM) until proven otherwise.
When it happens
Trigger: interest_download on a ch.interest.me / program.interest.me VOD page whose play-info JSON lacks the data.cdn.serverurl key — e.g. the JSON structure changed, the CDN fields were renamed, or geo/content restrictions return a reduced JSON.
Common situations: Site JSON schema drift; DRM/geo-blocked content that omits cdn info; pages where the scraped data: "..." URL returns an error payload instead of play info.
Related errors
- Server returned error:%s
- API returned fail
- Playlist is not supported for
- Share not found or canceled: %s
- Server refused to provide download link! (Errno:%s)
AI-assisted analysis of soimort/you-get@049548f3f3 (2026-08-15).
Data as JSON: /api/errors/5982735a63d87a8e.
Report an issue: GitHub.