ytdl-org/youtube-dl · error · ExtractorError

Unable to extract embedUrl

Error message

Unable to extract embedUrl

What it means

Raised by NDRIE when no embed URL could be determined: the initial regexes found nothing usable, and the sophora-ID fallback path (info-player template) also produced an empty embed_url. The extractor needs an embed URL or 'ndr:<id>' handle to delegate to the NDR base extractor, so without it, extraction stops. Not marked expected.

Source

Thrown at youtube_dl/extractor/ndr.py:139

                default=None)
            or self._search_regex(
                r'\bembedUrl["\']\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
                'embed URL', group='url', default=None)
            or self._search_regex(
                r'\bvar\s*sophoraID\s*=\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
                'embed URL', group='url', default=''))
        # some more work needed if we only found sophoraID
        if re.match(r'^[a-z]+\d+$', embed_url):
            # get the initial part of the url path,. eg /panorama/archiv/2022/
            parsed_url = compat_urllib_parse_urlparse(url)
            path = self._search_regex(r'(.+/)%s' % display_id, parsed_url.path or '', 'embed URL', default='')
            # find tell-tale image with the actual ID
            ndr_id = self._search_regex(r'%s([a-z]+\d+)(?!\.)\b' % (path, ), webpage, 'embed URL', default=None)
            # or try to use special knowledge!
            NDR_INFO_URL_TPL = 'https://www.ndr.de/info/%s-player.html'
            embed_url = 'ndr:%s' % (ndr_id, ) if ndr_id else NDR_INFO_URL_TPL % (embed_url, )
        if not embed_url:
            raise ExtractorError('Unable to extract embedUrl')

        description = self._search_regex(
            r'<p[^>]+itemprop="description">([^<]+)</p>',
            webpage, 'description', default=None) or self._og_search_description(webpage)
        timestamp = parse_iso8601(
            self._search_regex(
                (r'<span[^>]+itemprop="(?:datePublished|uploadDate)"[^>]+content="(?P<cont>[^"]+)"',
                 r'\bvar\s*pdt\s*=\s*(?P<q>["\'])(?P<cont>(?:(?!(?P=q)).)+)(?P=q)', ),
                webpage, 'upload date', group='cont', default=None))
        info = self._search_json_ld(webpage, display_id, default={})
        return merge_dicts({
            '_type': 'url_transparent',
            'url': embed_url,
            'display_id': display_id,
            'description': description,
            'timestamp': timestamp,
        }, info)

View on GitHub (pinned to 956b8c5855)

Solutions

  1. Update youtube-dl / use yt-dlp for current NDR parsing.
  2. Use the direct player form if you can find the ID: 'ndr:<sophora-id>' or the https://www.ndr.de/info/<id>-player.html URL the extractor itself constructs.
  3. Confirm the page actually contains AV media (not a text-only article) before retrying.

Example fix

# before
youtube-dl 'https://www.ndr.de/ndr_nachrichten/hamburg/Some-Article,article123.html'

# after (direct handle once the sophora id is known)
youtube-dl 'ndr:ndr12345'
Defensive patterns

Strategy: try-catch

Validate before calling

import requests, re
html = requests.get(url).text
if not re.search(r'(embedUrl|src="[^"]+-player\.html)', html):
    print('no NDR embed on page — likely a text article or new template')

Try / catch

except ExtractorError as e:
    if 'Unable to extract embedUrl' in str(e):
        nid = find_sophora_id_manually(url, html)  # image URLs carry article<id>
        if nid:
            retry('ndr:' + nid)
    else:
        raise

Prevention

When it happens

Trigger: An NDR page whose HTML yields no embed URL match, whose path regex and image-based ndr_id lookups both return None, leaving embed_url empty at the final check.

Common situations: NDR article pages with new templates lacking the embed markup; non-media articles mistakenly fed to the extractor; URL variants (redirects, canonical changes) that defeat the path regex.

Related errors


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