ytdl-org/youtube-dl · error · ExtractorError

error

Error message

error

What it means

Raised at the top of BBCCoUkIE._real_extract: after downloading the programme webpage, the extractor searches for a div with class 'smp__message delta' or 'playout__message delta' — the media player's inline notice area. If text is found there (e.g. 'This content is no longer available' or a geo notice), that raw text is re-raised verbatim as an expected ExtractorError. The generic message name 'error' in listings is just the _search_regex field label.

Source

Thrown at youtube_dl/extractor/bbc.py:550

            if programme_id:
                formats, subtitles = self._download_media_selector(programme_id)
            else:
                formats, subtitles = self._process_media_selector(item, playlist_id)
                programme_id = playlist_id

        return programme_id, title, description, duration, formats, subtitles

    def _real_extract(self, url):
        group_id = self._match_id(url)

        webpage = self._download_webpage(url, group_id, 'Downloading video page')

        error = self._search_regex(
            r'<div\b[^>]+\bclass=["\'](?:smp|playout)__message delta["\'][^>]*>\s*([^<]+?)\s*<',
            webpage, 'error', default=None)
        if error:
            raise ExtractorError(error, expected=True)

        programme_id = None
        duration = None

        tviplayer = self._search_regex(
            r'mediator\.bind\(({.+?})\s*,\s*document\.getElementById',
            webpage, 'player', default=None)

        if tviplayer:
            player = self._parse_json(tviplayer, group_id).get('player', {})
            duration = int_or_none(player.get('duration'))
            programme_id = player.get('vpid')

        if not programme_id:
            programme_id = self._search_regex(
                r'"vpid"\s*:\s*"(%s)"' % self._ID_REGEX, webpage, 'vpid', fatal=False, default=None)

        if programme_id:

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Read the raised message text — it is BBC's own player notice and states the actual cause (expiry, geo, etc.).
  2. For geo messages, retry from a UK IP.
  3. For expiry messages, look for a newer episode id on the series page.
  4. If the regex starts matching unrelated page copy after a redesign, tighten the pattern at bbc.py:550 and report upstream.
Defensive patterns

Strategy: try-catch

Validate before calling

import re, requests

def bbc_page_shows_player_error(url):
    html = requests.get(url).text
    m = re.search(r'<div\b[^>]+\bclass=["\'](?:smp|playout)__message delta["\'][^>]*>\s*([^<]+?)\s*<', html)
    return m.group(1) if m else None

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    msg = str(e)
    if 'only available' in msg or 'not available' in msg:
        show_user(msg)  # it's the BBC player's own notice; relay verbatim
    else:
        raise

Prevention

When it happens

Trigger: Any BBC programme page whose HTML contains a populated (smp|playout)__message delta div — the site's own way of saying the player cannot show media: expired episodes, geo blocks, or broken embeds. The regex captures the div's inner text and raises it.

Common situations: Following deep links to expired iPlayer episodes; non-UK IPs hitting geo notices rendered in the player message area; pages where the programme was replaced by a notice ('coming soon'); the CSS class renamed by a BBC redesign causing the regex to over/under-match.

Related errors


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