{"record":{"id":"28968c4022886314","repo":"ytdl-org/youtube-dl","slug":"no-media-information-found","errorCode":null,"errorMessage":"No media information found","messagePattern":"No media information found","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/srgssr.py","lineNumber":71,"sourceCode":"        token = self._download_json(\n            'http://tp.srgssr.ch/akahd/token?acl=*',\n            video_id, 'Downloading %s token' % format_id, fatal=False) or {}\n        auth_params = try_get(token, lambda x: x['token']['authparams'])\n        if auth_params:\n            url += ('?' if '?' not in url else '&') + auth_params\n        return url\n\n    def _get_media_data(self, bu, media_type, media_id):\n        query = {'onlyChapters': True} if media_type == 'video' else {}\n        full_media_data = self._download_json(\n            'https://il.srgssr.ch/integrationlayer/2.0/%s/mediaComposition/%s/%s.json'\n            % (bu, media_type, media_id),\n            media_id, query=query)['chapterList']\n        try:\n            media_data = next(\n                x for x in full_media_data if x.get('id') == media_id)\n        except StopIteration:\n            raise ExtractorError('No media information found')\n\n        block_reason = media_data.get('blockReason')\n        if block_reason and block_reason in self._ERRORS:\n            message = self._ERRORS[block_reason]\n            if block_reason == 'GEOBLOCK':\n                self.raise_geo_restricted(\n                    msg=message, countries=self._GEO_COUNTRIES)\n            raise ExtractorError(\n                '%s said: %s' % (self.IE_NAME, message), expected=True)\n\n        return media_data\n\n    def _real_extract(self, url):\n        bu, media_type, media_id = re.match(self._VALID_URL, url).groups()\n        media_data = self._get_media_data(bu, media_type, media_id)\n        title = media_data['title']\n\n        formats = []","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/srgssr.py#L53-L89","documentation":"SRGSSRIE._get_media_data downloads the integration-layer mediaComposition JSON and iterates chapterList looking for a chapter whose id equals the requested media_id. If no chapter matches (StopIteration from the generator), it raises 'No media information found' (unexpected, i.e. not marked expected=True). This indicates an id/API mismatch rather than a content policy error.","triggerScenarios":"Requesting a media id the API accepts (HTTP 200, valid chapterList) but that does not appear as a chapter id - e.g. using a show/anchor id instead of a chapter id, an id from a different business unit (SRF/RTR/RTS/RSI mismatch in the URL), or the composition returning only other chapters.","commonSituations":"URLs where the bu segment (srf/rts/...) does not match where the media actually lives; copied ids from the old 1.0 integration layer; content restructured so the requested id became a sub-chapter with a different key; API schema drift on old youtube-dl versions.","solutions":["Open the page in a browser and copy the canonical URL from the player/share button so bu and id match.","If you have a raw id, query https://il.srgssr.ch/integrationlayer/2.0/<bu>/mediaComposition/video/<id>.json yourself and inspect chapterList ids.","Ensure the bu segment matches the site you got the link from (SRF vs RTS etc.).","Update yt-dlp; the SRGSSR extractor was rewritten multiple times for API v2/v3 changes."],"exampleFix":"// before\ntry:\n    media_data = next(\n        x for x in full_media_data if x.get('id') == media_id)\nexcept StopIteration:\n    raise ExtractorError('No media information found')\n\n// after (fall back to the first chapter instead of failing)\nmedia_data = next(\n    (x for x in full_media_data if x.get('id') == media_id),\n    full_media_data[0] if full_media_data else None)\nif media_data is None:\n    raise ExtractorError('No media information found')","handlingStrategy":"validation","validationCode":"comp = requests.get(\n    'https://il.srgssr.ch/integrationlayer/2.0/%s/mediaComposition/%s/%s.json'\n    % (bu, media_type, media_id)).json()\nchapter_ids = [c.get('id') for c in comp.get('chapterList', [])]\nif media_id not in chapter_ids:\n    pick = chapter_ids[0] if chapter_ids else None\n    warn('id mismatch; available chapters: %s' % chapter_ids)","typeGuard":"def chapter_exists(comp: dict, media_id: str) -> bool:\n    return any(c.get('id') == media_id for c in comp.get('chapterList', []))","tryCatchPattern":"try:\n    extract(url)\nexcept ExtractorError as e:\n    if 'No media information found' == str(e):\n        recheck_bu_and_id(url)\n    else:\n        raise","preventionTips":["Always pair the correct business-unit segment (srf/rts/rsi/rtr) with the id.","Copy canonical player/share URLs rather than hand-building ids.","On mismatch, fall back to the first chapter id returned by the API."],"tags":["srgssr","id-mismatch","api-contract","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}