{"record":{"id":"be6b88599f4fc3bd","repo":"ytdl-org/youtube-dl","slug":"invalid-url-be6b88","errorCode":null,"errorMessage":"Invalid URL","messagePattern":"Invalid URL","errorType":"exception","errorClass":"ExtractorError","httpStatus":null,"severity":"error","filePath":"youtube_dl/extractor/pluralsight.py","lineNumber":284,"sourceCode":"                    '%d' % num,\n                    '%s --> %s' % (\n                        srt_subtitles_timecode(start),\n                        srt_subtitles_timecode(end)),\n                    text,\n                    os.linesep,\n                ))\n        return srt\n\n    def _real_extract(self, url):\n        qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)\n\n        author = qs.get('author', [None])[0]\n        name = qs.get('name', [None])[0]\n        clip_idx = qs.get('clip', [None])[0]\n        course_name = qs.get('course', [None])[0]\n\n        if any(not f for f in (author, name, clip_idx, course_name,)):\n            raise ExtractorError('Invalid URL', expected=True)\n\n        display_id = '%s-%s' % (name, clip_idx)\n\n        course = self._download_course(course_name, url, display_id)\n\n        collection = course['modules']\n\n        clip = None\n\n        for module_ in collection:\n            if name in (module_.get('moduleName'), module_.get('name')):\n                for clip_ in module_.get('clips', []):\n                    clip_index = clip_.get('clipIndex')\n                    if clip_index is None:\n                        clip_index = clip_.get('index')\n                    if clip_index is None:\n                        continue\n                    if compat_str(clip_index) == clip_idx:","sourceCodeStart":266,"sourceCodeEnd":302,"githubUrl":"https://github.com/ytdl-org/youtube-dl/blob/956b8c585591b401a543e409accb163eeaaa1193/youtube_dl/extractor/pluralsight.py#L266-L302","documentation":"PluralsightIE._real_extract raises ExtractorError('Invalid URL') when the matched URL's query string is missing (or has empty values for) any of the four required parameters: author, name, clip, or course. The extractor encodes the course author, clip name, clip index, and course name entirely in the URL query (e.g. pluralsight.com/course/clips?author=...&name=...&clip=...&course=...). It is marked expected=True, so youtube-dl treats it as a user-input error rather than a bug.","triggerScenarios":"Calling the extractor with a URL that matches _VALID_URL but lacks one of the query keys, e.g. 'https://app.pluralsight.com/player?name=some-clip&course=x' (no author/clip), or where a parameter is present but empty ('author=&name=...'). The check is `if any(not f for f in (author, name, clip_idx, course_name,))`.","commonSituations":"Hand-crafted or truncated Pluralsight URLs copied from browser address bars that drop query params; URL-shortened or redirected links that strip the query string; older pluralsight.com/course/... URLs that never carried these params.","solutions":["Supply the full URL with all four query parameters: author, name, clip, and course (e.g. ...?author=john&name=clip-slug&clip=3&course=course-slug).","Verify the URL against the extractor's _VALID_URL regex in youtube_dl/extractor/pluralsight.py before invoking it.","If building URLs programmatically, URL-encode each value and assert none is empty before calling youtube-dl."],"exampleFix":"# before\nurl = 'https://www.pluralsight.com/course/clips?name=intro&course=python'\n\n# after\nurl = 'https://www.pluralsight.com/course/clips?author=author-slug&name=intro&clip=0&course=python'","handlingStrategy":"validation","validationCode":"from urllib.parse import urlparse, parse_qs\n\ndef is_valid_pluralsight_url(url):\n    qs = parse_qs(urlparse(url).query)\n    required = ('author', 'name', 'clip', 'course')\n    return all(qs.get(k, [''])[0] for k in required)","typeGuard":null,"tryCatchPattern":"try:\n    ydl.extract_info(url)\nexcept ExtractorError as e:\n    if 'Invalid URL' in str(e):\n        # fix query params and retry once with corrected URL\n        ...","preventionTips":["Validate that author, name, clip and course query params are present and non-empty before extraction.","Build Pluralsight URLs from a single helper so params are never partially set.","URL-encode values; raw slugs with '&' or '=' silently break parse_qs."],"tags":["pluralsight","url-parsing","user-input","extractor"],"backgroundTag":null,"analyzedSha":"956b8c585591b401a543e409accb163eeaaa1193","analyzedAt":"2026-08-14T18:59:47.863Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}