{"record":{"id":"34d2a60a87aa5d0c","repo":"ytdl-org/youtube-dl","slug":"no-api-host-found","errorCode":null,"errorMessage":"No API host found","messagePattern":"No API host found","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/gbnews.py","lineNumber":94,"sourceCode":"            webpage, 'video data')\n\n        video_data = extract_attributes(video_data)\n        ss_id = video_data.get('data-id')\n        if not ss_id:\n            raise ExtractorError('Simplestream ID not found')\n\n        json_data = self._download_json(\n            self._SSMP_URL, display_id,\n            note='Downloading Simplestream JSON metadata',\n            errnote='Unable to download Simplestream JSON metadata',\n            query={\n                'id': ss_id,\n                'env': video_data.get('data-env', 'production'),\n            }, fatal=False)\n\n        meta_url = traverse_obj(json_data, ('response', 'api_hostname'))\n        if not meta_url:\n            raise ExtractorError('No API host found')\n\n        uvid = video_data['data-uvid']\n        dtype = video_data.get('data-type')\n        stream_data = self._download_json(\n            '%s/api/%s/stream/%s' % (meta_url, 'show' if dtype == 'vod' else dtype, uvid),\n            uvid,\n            query={\n                'key': video_data.get('data-key'),\n                'platform': self._PLATFORM,\n            },\n            headers={\n                'Token': video_data.get('data-token'),\n                'Token-Expiry': video_data.get('data-expiry'),\n                'Uvid': uvid,\n            }, fatal=False)\n\n        stream_url = traverse_obj(stream_data, (\n            'response', 'stream', T(url_or_none)))","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/gbnews.py#L76-L112","documentation":"Raised by the GB News extractor when the Simplestream metadata endpoint (self._SSMP_URL, downloaded with fatal=False) returns JSON lacking response.api_hostname. Because the download is non-fatal, network failure also funnels here: json_data can be None and traverse_obj yields nothing.","triggerScenarios":"Querying the SSMP endpoint with the page's data-id/data-env returns an error payload (bad/expired ID, wrong env) instead of {response: {api_hostname: ...}}, or the request silently failed because fatal=False swallowed the network error.","commonSituations":"Expired or removed video IDs, Simplestream rotating API hostnames without updating the SSMP service, data-env other than 'production' pointing at a dead environment, or transient network failures masked by fatal=False.","solutions":["Re-run with -v to see whether the SSMP JSON request actually failed (fatal=False hides it)","Update youtube-dl/yt-dlp to pick up SSMP URL/host changes","Manually curl the SSMP URL with the page's data-id and data-env to inspect the JSON returned","If the video was removed, try a different GB News URL or the broadcaster's official app"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import requests\nr = requests.get(SSMP_URL, params={'id': ss_id, 'env': env})\nif not r.ok() or not r.json().get('response', {}).get('api_hostname'):\n    print('SSMP metadata unavailable or missing api_hostname')","typeGuard":"def ssmp_meta_ok(json_data):\n    return (\n        isinstance(json_data, dict)\n        and isinstance(json_data.get('response'), dict)\n        and isinstance(json_data['response'].get('api_hostname'), str)\n    )","tryCatchPattern":"try:\n    info = ydl.extract_info(url)\nexcept DownloadError as e:\n    if 'No API host found' in str(e):\n        retry_later_or_report(url)  # could be transient (fatal=False) or site change\n    else:\n        raise","preventionTips":["Run with -v when this fires: fatal=False hides the underlying request failure","Retry once after a short delay — transient SSMP failures are common","Check data-env on the page matches an environment that still resolves"],"tags":["gbnews","simplestream","network","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}