ytdl-org/youtube-dl · error · ExtractorError

Invalid URL

Error message

Invalid URL

What it means

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.

Source

Thrown at youtube_dl/extractor/pluralsight.py:284

                    '%d' % num,
                    '%s --> %s' % (
                        srt_subtitles_timecode(start),
                        srt_subtitles_timecode(end)),
                    text,
                    os.linesep,
                ))
        return srt

    def _real_extract(self, url):
        qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query)

        author = qs.get('author', [None])[0]
        name = qs.get('name', [None])[0]
        clip_idx = qs.get('clip', [None])[0]
        course_name = qs.get('course', [None])[0]

        if any(not f for f in (author, name, clip_idx, course_name,)):
            raise ExtractorError('Invalid URL', expected=True)

        display_id = '%s-%s' % (name, clip_idx)

        course = self._download_course(course_name, url, display_id)

        collection = course['modules']

        clip = None

        for module_ in collection:
            if name in (module_.get('moduleName'), module_.get('name')):
                for clip_ in module_.get('clips', []):
                    clip_index = clip_.get('clipIndex')
                    if clip_index is None:
                        clip_index = clip_.get('index')
                    if clip_index is None:
                        continue
                    if compat_str(clip_index) == clip_idx:

View on GitHub (pinned to 956b8c5855)

Solutions

  1. 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).
  2. Verify the URL against the extractor's _VALID_URL regex in youtube_dl/extractor/pluralsight.py before invoking it.
  3. If building URLs programmatically, URL-encode each value and assert none is empty before calling youtube-dl.

Example fix

# before
url = 'https://www.pluralsight.com/course/clips?name=intro&course=python'

# after
url = 'https://www.pluralsight.com/course/clips?author=author-slug&name=intro&clip=0&course=python'
Defensive patterns

Strategy: validation

Validate before calling

from urllib.parse import urlparse, parse_qs

def is_valid_pluralsight_url(url):
    qs = parse_qs(urlparse(url).query)
    required = ('author', 'name', 'clip', 'course')
    return all(qs.get(k, [''])[0] for k in required)

Try / catch

try:
    ydl.extract_info(url)
except ExtractorError as e:
    if 'Invalid URL' in str(e):
        # fix query params and retry once with corrected URL
        ...

Prevention

When it happens

Trigger: 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,))`.

Common situations: 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.

Related errors


AI-assisted analysis of ytdl-org/youtube-dl@956b8c5855 (2026-08-14). Data as JSON: /api/errors/be6b88599f4fc3bd. Report an issue: GitHub.