ytdl-org/youtube-dl · error · ExtractorError
%s said: %s
Error message
%s said: %s
What it means
Generic API-failure error raised by ViuBaseIE._call_api when a request to https://www.viu.com/api/<path> succeeds at the HTTP level but the JSON response's response.status field is not 'success'. The message interpolates the IE name and the server-provided response.message, so the exact text varies. Expected=True keeps it a user-visible extraction error.
Source
Thrown at youtube_dl/extractor/viu.py:45
'platform': 'desktop',
'userid': 'guest',
'useridtype': 'guest',
'ver': '1.0'
}, headers=self.geo_verification_headers())
self._auth_token = viu_auth_res.info()['X-VIU-AUTH']
def _call_api(self, path, *args, **kwargs):
headers = self.geo_verification_headers()
headers.update({
'X-VIU-AUTH': self._auth_token
})
headers.update(kwargs.get('headers', {}))
kwargs['headers'] = headers
response = self._download_json(
'https://www.viu.com/api/' + path, *args,
**compat_kwargs(kwargs))['response']
if response.get('status') != 'success':
raise ExtractorError('%s said: %s' % (
self.IE_NAME, response['message']), expected=True)
return response
class ViuIE(ViuBaseIE):
_VALID_URL = r'(?:viu:|https?://[^/]+\.viu\.com/[a-z]{2}/media/)(?P<id>\d+)'
_TESTS = [{
'url': 'https://www.viu.com/en/media/1116705532?containerId=playlist-22168059',
'info_dict': {
'id': '1116705532',
'ext': 'mp4',
'title': 'Citizen Khan - Ep 1',
'description': 'md5:d7ea1604f49e5ba79c212c551ce2110e',
},
'params': {
'skip_download': 'm3u8 download',
},
'skip': 'Geo-restricted to India',View on GitHub (pinned to 956b8c5855)
Solutions
- Read the interpolated server message — it is the actual API explanation (e.g. token invalid, geo-blocked)
- Refresh any authentication cookies/tokens used to build X-VIU-AUTH before extraction
- Route the request through a region where the content is available (the API is geo-sensitive via geo_verification_headers)
Defensive patterns
Strategy: try-catch
Try / catch
from youtube_dl.utils import ExtractorError
try:
info = ydl.extract_info(viu_url)
except ExtractorError as e:
msg = str(e)
if 'geo' in msg.lower():
log('region-locked, skipping')
elif 'token' in msg.lower():
refresh_viu_token(); retry = True
else:
raise Prevention
- Refresh the X-VIU-AUTH token before each batch run
- Log the interpolated server message — it distinguishes auth vs geo failures
- Mark failing IDs and back off instead of re-hitting the API
When it happens
Trigger: Any _download_json call to viu.com/api/* (e.g. playlist or media endpoints) whose parsed ['response']['status'] != 'success'; typical causes are invalid/expired X-VIU-AUTH tokens, bad parameters, or region-locked content.
Common situations: Expired or missing VIU auth token; requesting content not licensed for the requesting country; upstream API schema changes after a site redesign.
Related errors
AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14).
Data as JSON: /api/errors/becc7704f2bbf9e5.
Report an issue: GitHub.