ytdl-org/youtube-dl · error · ExtractorError

Item not found in collection

Error message

Item not found in collection

What it means

Raised by ORFRadiothekIE (ORF Radiothek collection extractor) when a specific item_id was requested from a station/collection but no matching item was found in the API's 'content/items' list. It is an expected ExtractorError, meaning the site data simply does not contain the requested episode/upload. The for/else construct only raises when item_id was non-None and the loop completed without a break.

Source

Thrown at youtube_dl/extractor/orf.py:234

            'https://collector.orf.at/api/frontend/collections/{0}?_o=sound.orf.at'.format(
                coll_id), coll_id)
        data = self._get_api_payload(data, coll_id, in_payload=True)

        def yield_items():
            for item in traverse_obj(data, (
                    'content', 'items', lambda _, v: any(k in v['target']['params'] for k in self._ID_NAMES))):
                if item_id is None or item_id == txt_or_none(item.get('id')):
                    target = item['target']
                    typed_item_id = self._get_item_id(target['params'])
                    station = target['params'].get('station')
                    item_type = target.get('type')
                    if typed_item_id and (station or item_type):
                        yield station, typed_item_id, item_type
                    if item_id is not None:
                        break
            else:
                if item_id is not None:
                    raise ExtractorError('Item not found in collection',
                                         video_id=coll_id, expected=True)

        def item_playlist(station, typed_item_id, item_type):
            if item_type == 'upload':
                item_data = self._download_json('https://audioapi.orf.at/radiothek/api/2.0/upload/{0}?_o=sound.orf.at'.format(
                    typed_item_id), typed_item_id)
            elif item_type == 'podcast-episode':
                item_data = self._download_json('https://audioapi.orf.at/radiothek/api/2.0/episode/{0}?_o=sound.orf.at'.format(
                    typed_item_id), typed_item_id)
            else:
                api_station, _, _ = self.STATION_INFO[station]
                item_data = self._download_json(
                    'https://audioapi.orf.at/{0}/api/json/5.0/{1}/{2}?_o=sound.orf.at'.format(
                        api_station, item_type or 'broadcastitem', typed_item_id), typed_item_id)

            item_data = self._get_api_payload(item_data, typed_item_id, in_payload=True)

            return merge_dicts(

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Retry with the plain collection URL (no item id) so the extractor yields every item instead of hunting one id
  2. Verify the item id in the URL against the current ORF Audiothek website listing
  3. If the episode was removed upstream, accept it is gone and source audio elsewhere

Example fix

# before
youtube_dl 'https://audioapi.orf.at/radiothek/w/1234567?item=7654321'
# after
youtube_dl 'https://audioapi.orf.at/radiothek/w/1234567'  # whole collection, then filter locally
Defensive patterns

Strategy: try-catch

Try / catch

try:
    info = ydl.extract_info(url, download=False)
except ExtractorError as e:
    if e.expected and 'Item not found in collection' in str(e):
        info = ydl.extract_info(collection_url_without_item, download=False)
    else:
        raise

Prevention

When it happens

Trigger: Calling an ORF Radiothek URL with an explicit item id (e.g. the 'item' query segment of a collection URL) where the API response's items array contains no entry whose target params include that id under any of self._ID_NAMES. Happens when the episode was removed from the collection or the URL's item id is stale/typo'd.

Common situations: Linking to a specific episode inside an ORF radiothek collection after the episode was unpublished; using archived URLs from playlists; site reorganized its audiothek API so ids no longer match.

Related errors


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