{"record":{"id":"ade44b733d92fe42","repo":"ytdl-org/youtube-dl","slug":"invalid-url-ade44b","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/rice.py","lineNumber":35,"sourceCode":"class RICEIE(InfoExtractor):\n    _VALID_URL = r'https?://mediahub\\.rice\\.edu/app/[Pp]ortal/video\\.aspx\\?(?P<query>.+)'\n    _TEST = {\n        'url': 'https://mediahub.rice.edu/app/Portal/video.aspx?PortalID=25ffd62c-3d01-4b29-8c70-7c94270efb3e&DestinationID=66bc9434-03bd-4725-b47e-c659d8d809db&ContentID=YEWIvbhb40aqdjMD1ALSqw',\n        'md5': '9b83b4a2eead4912dc3b7fac7c449b6a',\n        'info_dict': {\n            'id': 'YEWIvbhb40aqdjMD1ALSqw',\n            'ext': 'mp4',\n            'title': 'Active Learning in Archeology',\n            'upload_date': '20140616',\n            'timestamp': 1402926346,\n        }\n    }\n    _NS = 'http://schemas.datacontract.org/2004/07/ensembleVideo.Data.Service.Contracts.Models.Player.Config'\n\n    def _real_extract(self, url):\n        qs = compat_parse_qs(re.match(self._VALID_URL, url).group('query'))\n        if not qs.get('PortalID') or not qs.get('DestinationID') or not qs.get('ContentID'):\n            raise ExtractorError('Invalid URL', expected=True)\n\n        portal_id = qs['PortalID'][0]\n        playlist_id = qs['DestinationID'][0]\n        content_id = qs['ContentID'][0]\n\n        content_data = self._download_xml('https://mediahub.rice.edu/api/portal/GetContentTitle', content_id, query={\n            'portalId': portal_id,\n            'playlistId': playlist_id,\n            'contentId': content_id\n        })\n        metadata = xpath_element(content_data, './/metaData', fatal=True)\n        title = xpath_text(metadata, 'primaryTitle', fatal=True)\n        encodings = xpath_element(content_data, './/encodings', fatal=True)\n        player_data = self._download_xml('https://mediahub.rice.edu/api/player/GetPlayerConfig', content_id, query={\n            'temporaryLinkId': xpath_text(encodings, 'temporaryLinkId', fatal=True),\n            'contentId': content_id,\n        })\n","sourceCodeStart":17,"sourceCodeEnd":53,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/rice.py#L17-L53","documentation":"Raised by the Rice University (mediahub.rice.edu, Ensemble Video platform) extractor when the URL's query string is missing any of PortalID, DestinationID or ContentID parameters. The extractor parses the query string via regex and requires all three ids before it can call the GetContentTitle API. Expected=True.","triggerScenarios":"A URL matching _VALID_URL whose query string lacks ?PortalID=...&DestinationID=...&ContentID=..., e.g. a truncated/copy-pasted embed URL or one where a parameter was renamed by the site.","commonSituations":"Copying only part of an embed iframe src; the portal migrating and dropping a parameter; URL-encoding mistakes stripping ampersands.","solutions":["Get the complete embed URL from the page's iframe/embed code and use it verbatim, including all three query parameters.","Manually append the missing parameter(s) if you know the ids from the original page.","If the site genuinely dropped a parameter from its embeds, the extractor's requirement is stale - update youtube-dl or fix the qs check in rice.py."],"exampleFix":"# before (missing params)\nhttps://mediahub.rice.edu/Portals/Embed.aspx?PortalID=7&ContentID=123\n# after\nhttps://mediahub.rice.edu/Portals/Embed.aspx?PortalID=7&DestinationID=45&ContentID=123","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse, parse_qs\ndef valid_rice_url(url):\n    qs = parse_qs(urlparse(url).query)\n    return all(qs.get(k) for k in ('PortalID', 'DestinationID', 'ContentID'))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always copy the complete iframe embed src, never hand-type Rice/Ensemble URLs.","Run the query-string check above before queuing the download.","If a param is genuinely absent from the page's embed code, the site changed - get the new embed."],"tags":["rice","ensemble-video","invalid-url","query-params","expected-error"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}