Skip to content

FetchError: "Forbidden" Response from Pluralsight API During Video Metadata Retrieval #37

@bilalelmahdaoui

Description

@bilalelmahdaoui

I am encountering a FetchError when attempting to download courses using the Pluralsight scraper. Specifically, the error occurs while fetching video metadata from the endpoint https://app.pluralsight.com/video/clips/v3/viewclip. The error message indicates an "invalid JSON response body" with the reason: "Forbidden".

Steps to Reproduce:

Run the command:
npm run get -- "https://app.pluralsight.com/library/courses/rust-fundamentals/table-of-contents"

Observe the error in the logs.

Logs:

Downloading course: rust-fundamentals
Retrieving metadata for: 1. Course Overview
FetchError: invalid json response body at https://app.pluralsight.com/video/clips/v3/viewclip reason: Unexpected token 'F', "Forbidden" is not valid JSON
    at /path/to/node_modules/node-fetch/lib/index.js:273:32
    ...
    at async getVideoUrl (/path/to/script.js:17:20)

Expected Behavior:

The scraper should fetch the metadata and download the course videos successfully.

Actual Behavior:

The fetch request to the API endpoint returns a 403 Forbidden response, preventing further execution.

Additional Information:

The cookie file (cookies.txt) exists and is populated after logging in.
Delay between requests is set to 137 seconds to avoid throttling.
Possible issue with headers or authentication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions