{"record":{"id":"1343f126aa3c8819","repo":"ytdl-org/youtube-dl","slug":"invalid-url-1343f1","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/pandoratv.py","lineNumber":83,"sourceCode":"    }, {\n        'url': 'http://www.pandora.tv/view/mikakim/53294230#36797454_new',\n        'only_matching': True,\n    }, {\n        'url': 'http://m.pandora.tv/?c=view&ch_userid=mikakim&prgid=54600346',\n        'only_matching': True,\n    }]\n\n    def _real_extract(self, url):\n        mobj = re.match(self._VALID_URL, url)\n        user_id = mobj.group('user_id')\n        video_id = mobj.group('id')\n\n        if not user_id or not video_id:\n            qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)\n            video_id = qs.get('prgid', [None])[0]\n            user_id = qs.get('ch_userid', [None])[0]\n            if any(not f for f in (video_id, user_id,)):\n                raise ExtractorError('Invalid URL', expected=True)\n\n        data = self._download_json(\n            'http://m.pandora.tv/?c=view&m=viewJsonApi&ch_userid=%s&prgid=%s'\n            % (user_id, video_id), video_id)\n\n        info = data['data']['rows']['vod_play_info']['result']\n\n        formats = []\n        for format_id, format_url in info.items():\n            if not format_url:\n                continue\n            height = self._search_regex(\n                r'^v(\\d+)[Uu]rl$', format_id, 'height', default=None)\n            if not height:\n                continue\n\n            play_url = self._download_json(\n                'http://m.pandora.tv/?c=api&m=play_url', video_id,","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/pandoratv.py#L65-L101","documentation":"Raised by the PandoraTV extractor when the URL matches _VALID_URL's broad pattern but the user_id or video id groups are empty, AND the fallback query-string parse of 'prgid'/'ch_userid' also yields at least one empty value. It signals the URL is structurally recognizable but missing the identifiers needed to call Pandora's viewJsonApi endpoint.","triggerScenarios":"A URL like 'https://www.pandora.tv/view/...?prgid=...' where prgid or ch_userid is absent/blank, or a channel URL with no video id. The extractor first tries regex groups, then query params, then gives up with expected=True.","commonSituations":"Copy-pasting a PandoraTV channel page or playlist page URL instead of a single video URL; URLs truncated when shared through messaging apps; PandoraTV changing their URL scheme so the regex groups no longer capture.","solutions":["Open the video in a browser, copy the full canonical video URL containing both ch_userid and prgid","Ensure the URL includes the query string '?prgid=...&ch_userid=...' if using the mobile/pandora.tv root form","Update youtube-dl/yt-dlp — a newer regex may cover the URL shape you have"],"exampleFix":"# before\nyoutube_dl 'https://www.pandora.tv/view/xkxkxk228/#!'  # channel/ambiguous URL\n# after\nyoutube_dl 'https://www.pandora.tv/view/someuser/#!/someuser@26970362'  # full video URL with both ids","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse, parse_qs\n\ndef is_valid_pandoratv_url(url: str) -> bool:\n    q = parse_qs(urlparse(url).query)\n    return bool(q.get('prgid', [''])[0] and q.get('ch_userid', [''])[0])\n\nif not is_valid_pandoratv_url(url):\n    raise ValueError('Need a PandoraTV video URL with prgid and ch_userid')","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Invalid URL' in str(e):\n        # fetch the canonical URL from the page or search result\n        ...","preventionTips":["Always capture full video URLs including query strings","Validate URL shape with a pre-check before invoking the extractor","Log the URL alongside the failure for triage"],"tags":["pandoratv","invalid-url","url-parsing","extractor-error","expected"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}