ytdl-org/youtube-dl · error · ExtractorError

No media information found

Error message

No media information found

What it means

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.

Source

Thrown at youtube_dl/extractor/srgssr.py:71

        token = self._download_json(
            'http://tp.srgssr.ch/akahd/token?acl=*',
            video_id, 'Downloading %s token' % format_id, fatal=False) or {}
        auth_params = try_get(token, lambda x: x['token']['authparams'])
        if auth_params:
            url += ('?' if '?' not in url else '&') + auth_params
        return url

    def _get_media_data(self, bu, media_type, media_id):
        query = {'onlyChapters': True} if media_type == 'video' else {}
        full_media_data = self._download_json(
            'https://il.srgssr.ch/integrationlayer/2.0/%s/mediaComposition/%s/%s.json'
            % (bu, media_type, media_id),
            media_id, query=query)['chapterList']
        try:
            media_data = next(
                x for x in full_media_data if x.get('id') == media_id)
        except StopIteration:
            raise ExtractorError('No media information found')

        block_reason = media_data.get('blockReason')
        if block_reason and block_reason in self._ERRORS:
            message = self._ERRORS[block_reason]
            if block_reason == 'GEOBLOCK':
                self.raise_geo_restricted(
                    msg=message, countries=self._GEO_COUNTRIES)
            raise ExtractorError(
                '%s said: %s' % (self.IE_NAME, message), expected=True)

        return media_data

    def _real_extract(self, url):
        bu, media_type, media_id = re.match(self._VALID_URL, url).groups()
        media_data = self._get_media_data(bu, media_type, media_id)
        title = media_data['title']

        formats = []

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Open the page in a browser and copy the canonical URL from the player/share button so bu and id match.
  2. If you have a raw id, query https://il.srgssr.ch/integrationlayer/2.0/<bu>/mediaComposition/video/<id>.json yourself and inspect chapterList ids.
  3. Ensure the bu segment matches the site you got the link from (SRF vs RTS etc.).
  4. Update yt-dlp; the SRGSSR extractor was rewritten multiple times for API v2/v3 changes.

Example fix

// before
try:
    media_data = next(
        x for x in full_media_data if x.get('id') == media_id)
except StopIteration:
    raise ExtractorError('No media information found')

// after (fall back to the first chapter instead of failing)
media_data = next(
    (x for x in full_media_data if x.get('id') == media_id),
    full_media_data[0] if full_media_data else None)
if media_data is None:
    raise ExtractorError('No media information found')
Defensive patterns

Strategy: validation

Validate before calling

comp = requests.get(
    'https://il.srgssr.ch/integrationlayer/2.0/%s/mediaComposition/%s/%s.json'
    % (bu, media_type, media_id)).json()
chapter_ids = [c.get('id') for c in comp.get('chapterList', [])]
if media_id not in chapter_ids:
    pick = chapter_ids[0] if chapter_ids else None
    warn('id mismatch; available chapters: %s' % chapter_ids)

Type guard

def chapter_exists(comp: dict, media_id: str) -> bool:
    return any(c.get('id') == media_id for c in comp.get('chapterList', []))

Try / catch

try:
    extract(url)
except ExtractorError as e:
    if 'No media information found' == str(e):
        recheck_bu_and_id(url)
    else:
        raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/28968c4022886314. Report an issue: GitHub.