ytdl-org/youtube-dl · error · ExtractorError

%s returned error: %s - %s

Error message

%s returned error: %s - %s

What it means

Sport5IE downloads the site's metadata.xml for a clip; if the XML root contains an <Error> element, the child <Name> and <Description> texts are formatted into '<Sport5> returned error: <name> - <description>' and raised as expected. This is the CDN's structured way of reporting dead or inaccessible clips instead of an HTTP error.

Source

Thrown at youtube_dl/extractor/sport5.py:52

            'skip': 'Blocked outside of Israel',
        }
    ]

    def _real_extract(self, url):
        mobj = re.match(self._VALID_URL, url)
        media_id = mobj.group('id')

        webpage = self._download_webpage(url, media_id)

        video_id = self._html_search_regex(r'clipId=([\w-]+)', webpage, 'video id')

        metadata = self._download_xml(
            'http://sport5-metadata-rr-d.nsacdn.com/vod/vod/%s/HDS/metadata.xml' % video_id,
            video_id)

        error = metadata.find('./Error')
        if error is not None:
            raise ExtractorError(
                '%s returned error: %s - %s' % (
                    self.IE_NAME,
                    error.find('./Name').text,
                    error.find('./Description').text),
                expected=True)

        title = metadata.find('./Title').text
        description = metadata.find('./Description').text
        duration = int(metadata.find('./Duration').text)

        posters_el = metadata.find('./PosterLinks')
        thumbnails = [{
            'url': thumbnail.text,
            'width': int(thumbnail.get('width')),
            'height': int(thumbnail.get('height')),
        } for thumbnail in posters_el.findall('./PosterIMG')] if posters_el is not None else []

        categories_el = metadata.find('./Categories')

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Read the Name/Description text - it names the exact failure.
  2. Open the article page in a browser to check whether the video still plays.
  3. Retry later if the site was under maintenance; otherwise find the clip on another source.
  4. Update yt-dlp - sport5's endpoints have changed over time and the extractor was since reworked.
Defensive patterns

Strategy: try-catch

Validate before calling

meta = requests.get(metadata_xml_url).content
if b'<Error>' in meta:
    skip(video_id)  # CDN already reports the clip dead

Type guard

def metadata_has_error(xml_bytes: bytes) -> bool:
    return b'<Error>' in xml_bytes

Try / catch

try:
    extract(url)
except ExtractorError as e:
    if 'returned error:' in str(e):
        drop(video_id)
    else:
        raise

Prevention

When it happens

Trigger: Fetching http://sport5-metadata-rr-d.nsacdn.com/vod/vod/<clipId>/HDS/metadata.xml for a clipId scraped from the page where the XML is <Error><Name>...<Description>...</Error>. Occurs for removed/expired VOD clips or ids for content no longer served.

Common situations: Old sport5.co.il article links whose video clips expired (Israeli sports VOD has short retention); clip ids changed after site migration; the metadata CDN serving errors during maintenance windows.

Related errors


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