{"record":{"id":"9d03a62b8271f8ff","repo":"ytdl-org/youtube-dl","slug":"unable-to-extract-embedurl","errorCode":null,"errorMessage":"Unable to extract embedUrl","messagePattern":"Unable to extract embedUrl","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/ndr.py","lineNumber":139,"sourceCode":"                default=None)\n            or self._search_regex(\n                r'\\bembedUrl[\"\\']\\s*:\\s*([\"\\'])(?P<url>(?:(?!\\1).)+)\\1', webpage,\n                'embed URL', group='url', default=None)\n            or self._search_regex(\n                r'\\bvar\\s*sophoraID\\s*=\\s*([\"\\'])(?P<url>(?:(?!\\1).)+)\\1', webpage,\n                'embed URL', group='url', default=''))\n        # some more work needed if we only found sophoraID\n        if re.match(r'^[a-z]+\\d+$', embed_url):\n            # get the initial part of the url path,. eg /panorama/archiv/2022/\n            parsed_url = compat_urllib_parse_urlparse(url)\n            path = self._search_regex(r'(.+/)%s' % display_id, parsed_url.path or '', 'embed URL', default='')\n            # find tell-tale image with the actual ID\n            ndr_id = self._search_regex(r'%s([a-z]+\\d+)(?!\\.)\\b' % (path, ), webpage, 'embed URL', default=None)\n            # or try to use special knowledge!\n            NDR_INFO_URL_TPL = 'https://www.ndr.de/info/%s-player.html'\n            embed_url = 'ndr:%s' % (ndr_id, ) if ndr_id else NDR_INFO_URL_TPL % (embed_url, )\n        if not embed_url:\n            raise ExtractorError('Unable to extract embedUrl')\n\n        description = self._search_regex(\n            r'<p[^>]+itemprop=\"description\">([^<]+)</p>',\n            webpage, 'description', default=None) or self._og_search_description(webpage)\n        timestamp = parse_iso8601(\n            self._search_regex(\n                (r'<span[^>]+itemprop=\"(?:datePublished|uploadDate)\"[^>]+content=\"(?P<cont>[^\"]+)\"',\n                 r'\\bvar\\s*pdt\\s*=\\s*(?P<q>[\"\\'])(?P<cont>(?:(?!(?P=q)).)+)(?P=q)', ),\n                webpage, 'upload date', group='cont', default=None))\n        info = self._search_json_ld(webpage, display_id, default={})\n        return merge_dicts({\n            '_type': 'url_transparent',\n            'url': embed_url,\n            'display_id': display_id,\n            'description': description,\n            'timestamp': timestamp,\n        }, info)\n","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/ndr.py#L121-L157","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Update youtube-dl / use yt-dlp for current NDR parsing.","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.","Confirm the page actually contains AV media (not a text-only article) before retrying."],"exampleFix":"# before\nyoutube-dl 'https://www.ndr.de/ndr_nachrichten/hamburg/Some-Article,article123.html'\n\n# after (direct handle once the sophora id is known)\nyoutube-dl 'ndr:ndr12345'","handlingStrategy":"try-catch","validationCode":"import requests, re\nhtml = requests.get(url).text\nif not re.search(r'(embedUrl|src=\"[^\"]+-player\\.html)', html):\n    print('no NDR embed on page — likely a text article or new template')","typeGuard":null,"tryCatchPattern":"except ExtractorError as e:\n    if 'Unable to extract embedUrl' in str(e):\n        nid = find_sophora_id_manually(url, html)  # image URLs carry article<id>\n        if nid:\n            retry('ndr:' + nid)\n    else:\n        raise","preventionTips":["Prefer the canonical 'ndr:<sophora-id>' form when you already know the media ID.","Only feed pages that actually contain AV media to the extractor.","Update yt-dlp for NDR template changes."],"tags":["extractor","api-change","embed","unexpected-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}