{"record":{"id":"525863528793c51f","repo":"ytdl-org/youtube-dl","slug":"s-returned-error-s-525863","errorCode":null,"errorMessage":"%s returned error: %s","messagePattern":"(.+?) returned error: (.+?)","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/ustream.py","lineNumber":191,"sourceCode":"            video_id = m.group('id')\n            desktop_url = 'http://www.ustream.tv/recorded/' + video_id\n            return self.url_result(desktop_url, 'Ustream')\n        if m.group('type') == 'embed':\n            video_id = m.group('id')\n            webpage = self._download_webpage(url, video_id)\n            content_video_ids = self._parse_json(self._search_regex(\n                r'ustream\\.vars\\.offAirContentVideoIds=([^;]+);', webpage,\n                'content video IDs'), video_id)\n            return self.playlist_result(\n                map(lambda u: self.url_result('http://www.ustream.tv/recorded/' + u, 'Ustream'), content_video_ids),\n                video_id)\n\n        params = self._download_json(\n            'https://api.ustream.tv/videos/%s.json' % video_id, video_id)\n\n        error = params.get('error')\n        if error:\n            raise ExtractorError(\n                '%s returned error: %s' % (self.IE_NAME, error), expected=True)\n\n        video = params['video']\n\n        title = video['title']\n        filesize = float_or_none(video.get('file_size'))\n\n        formats = [{\n            'id': video_id,\n            'url': video_url,\n            'ext': format_id,\n            'filesize': filesize,\n        } for format_id, video_url in video['media_urls'].items() if video_url]\n\n        if not formats:\n            hls_streams = self._get_streams(url, video_id, app_id_ver=(11, 2))\n            if hls_streams:\n                # m3u8_native leads to intermittent ContentTooShortError","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/ustream.py#L173-L209","documentation":"Raised by the Ustream extractor when the api.ustream.tv/videos/<id>.json response contains a non-empty top-level 'error' key; the API's own message is passed through. It signals the API rejected the request (video deleted, private, not found) after the HTTP layer succeeded. expected=True means the site itself reported the failure.","triggerScenarios":"Extracting a recorded Ustream URL whose id the API answers with {\"error\": \"...\"} — deleted recordings, private channels, or ids that only exist as channel pages handled earlier by the offAirContentVideoIds branch.","commonSituations":"IBM closed/migrated Ustream content after the IBM Cloud Video acquisition; old links in playlists now resolve to removed recordings; geo- or rights-restricted streams.","solutions":["Open the ustream.tv/recorded/<id> URL in a browser to confirm the recording still exists.","If the page works but the API fails, the API contract changed — check the response body of api.ustream.tv/videos/<id>.json and update the extractor (endpoint, auth, or error shape).","For channel URLs, verify you are hitting the playlist path (offAirContentVideoIds) rather than the single-video API branch.","Catch and report the API's error text to the user; retrying will not help."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import json, urllib.request\nresp = json.load(urllib.request.urlopen('https://api.ustream.tv/videos/%s.json' % video_id))\nif resp.get('error'):\n    skip(video_id, 'ustream api: %s' % resp['error'])","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if e.expected and 'returned error:' in str(e):\n        log_skip(url, str(e))  # API's own rejection — permanent\n    else:\n        raise","preventionTips":["Query the videos/<id>.json API first to check for an error field.","Expect Ustream content to disappear after the IBM shutdown; prune dead links from archives.","Do not retry expected API rejections."],"tags":["api","site-side-rejection","content-missing","service-shutdown"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}