{"record":{"id":"e7f4b94bc98fd843","repo":"ytdl-org/youtube-dl","slug":"invalid-url-e7f4b9","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/kaltura.py","lineNumber":241,"sourceCode":"                'ks': '{1:result:ks}',\n            },\n        ]\n        return self._kaltura_api_call(\n            video_id, actions, service_url, note='Downloading video info JSON')\n\n    def _real_extract(self, url):\n        url, smuggled_data = unsmuggle_url(url, {})\n\n        mobj = re.match(self._VALID_URL, url)\n        partner_id, entry_id = mobj.group('partner_id', 'id')\n        ks = None\n        captions = None\n        if partner_id and entry_id:\n            _, info, flavor_assets, captions = self._get_video_info(entry_id, partner_id, smuggled_data.get('service_url'))\n        else:\n            path, query = mobj.group('path', 'query')\n            if not path and not query:\n                raise ExtractorError('Invalid URL', expected=True)\n            params = {}\n            if query:\n                params = compat_parse_qs(query)\n            if path:\n                splitted_path = path.split('/')\n                params.update(dict((zip(splitted_path[::2], [[v] for v in splitted_path[1::2]]))))\n            if 'wid' in params:\n                partner_id = params['wid'][0][1:]\n            elif 'p' in params:\n                partner_id = params['p'][0]\n            elif 'partner_id' in params:\n                partner_id = params['partner_id'][0]\n            else:\n                raise ExtractorError('Invalid URL', expected=True)\n            if 'entry_id' in params:\n                entry_id = params['entry_id'][0]\n                _, info, flavor_assets, captions = self._get_video_info(entry_id, partner_id)\n            elif 'uiconf_id' in params and 'flashvars[referenceId]' in params:","sourceCodeStart":223,"sourceCodeEnd":259,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/kaltura.py#L223-L259","documentation":"Raised by KalturaIE._real_extract for a URL that matched _VALID_URL but contained neither a path nor a query string beyond the host. The extractor requires partner_id+entry_id directly in the URL, or a path/query carrying wid/p/partner_id parameters; with both empty there is nothing to dispatch on, so it fails fast with an expected error.","triggerScenarios":"URLs like 'http://cdnapi.kaltura.com/' or a bare Kaltura host that regex-matched but whose named groups 'path' and 'query' are both empty - typically hand-typed or truncated embed URLs.","commonSituations":"Users strip the query string (?wid=...&entry_id=...) when copying Kaltura embed URLs, or a CMS mangles the URL and drops everything after the host.","solutions":["Re-copy the complete embed URL including the query string (wid/p/partner_id and entry_id/uiconf_id).","Prefer the full iframe src attribute from the page's HTML.","Construct the canonical form: <kaltura_host>/.../entry_id/<ID> or keep ?entry_id=...&p=..."],"exampleFix":"// before\nyoutube_dl 'http://cdnapi.kaltura.com/'\n# => Invalid URL\n\n// after\nyoutube_dl 'http://cdnapi.kaltura.com/html5/html5lib/v2.86/mwEmbedFrame.php?wid=_123456&entry_id=1_abcdefg'","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse, parse_qs\nu = urlparse(candidate_url)\nq = parse_qs(u.query)\nhas_path_params = len(u.path.strip('/').split('/')) >= 2\nif not q and not has_path_params:\n    reject('Kaltura URL lacks path and query parameters')","typeGuard":"def is_actionable_kaltura_url(url: str) -> bool:\n    p = urlparse(url)\n    return bool(p.path.strip('/')) or bool(p.query)","tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if str(e) == 'Invalid URL':\n        re_fetch_embed_src_from_page(page_url)  # URL was truncated; get original iframe src","preventionTips":["Copy Kaltura URLs from iframe src attributes verbatim.","Validate that the URL has a non-empty path or query before queueing.","Reject bare-host Kaltura URLs at ingestion."],"tags":["validation","url-parsing","extractor","kaltura","user-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}