Skip to content

Instantly share code, notes, and snippets.

@sachithsujeewa
Forked from edgardo001/youtube-dl.md
Last active September 3, 2021 10:05
Show Gist options
  • Save sachithsujeewa/869966d61413877188bc99956fee927a to your computer and use it in GitHub Desktop.
Save sachithsujeewa/869966d61413877188bc99956fee927a to your computer and use it in GitHub Desktop.
Using youtube-dl to download courses from Pluralsight

Download courses from learning sites with youtube-dl

You can download whole courses from an array of tutorial sites with the CLI tool youtube-dl. In the example further down I'm using my Pluralsight account to get videos from a course at their site. Here is a list of all supported sites that you can download from with this tool

The flags you have to supply may vary depending on which site you make a request to.

You can get a free 3 month trial to Pluralsight by signing up for free to Visual Studio Dev Essentials

Installation

For macOS/UNIX

With brew for macOS:

brew install youtube-dl

With npm:

npm install youtube-dl

Or you can curl/wget the thing:

sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl
sudo chmod a+rx /usr/local/bin/youtube-dl
For Windows

Download with npm as above or just download the exe-file from the link below and put the exe in your PATH.

Or download with npm like above.

Source: youtube-dl download

Usage

Example: download from Pluralsight

Regular username and password option will not with the latest pluralsight updates. Instead use the cookie option by follow these steps

  1. Install editThisCookie extension to your browser
  2. Go to extension options and set format (defaults to JSON) to Netscape HTTP Cookie file
  3. Login into Pluralsight Click on the EdiThisCookie icon, select Export, paste the cookies into a file called cookies.txt
  4. Add the following switch to youtube-dl --cookie <path to cookies.txt>

Example: If you are downloading same folder where cookies.txt is located

youtube-dl --cookie cookies.txt --verbose --sleep-interval 120 "https://app.pluralsight.com/library/courses/microsoft-azure-the-big-picture"

Add --all-subs if you want subtitles downloaded and --restrict-filenames if you have a problem with failing filenames on download.

UPDATE 2019-04-17

I haven't used this in a while and not tested it lately. But according to comments below by @mercxry (thank you!) this should work on atleast MacOS where you replace the username, password and path to your folder to your own credentials. This will also let you format the output better and categorize the files.

youtube-dl --username "username" --password "password" -o "~/path/to/course/folder/%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s" --min-sleep-interval 30 --max-sleep-interval 60 https://app.pluralsight.com/library/courses/python-big-picture/ --playlist-start 1

I do not know which length of sleep-interval to use anymore, you have to try for yourself. Higher value -> safer but also slower.

IMPORTANT

The argument --sleep-interval 120 is important. It means that the program will wait 120s (2 minutes) before it downloads the next video. If you don't use this flag Pluralsight will ban you because you are doing too many requests under a short period of time. This interval was the sleep interval that was suggested 2 years ago when I first wrote this based on issues in the youtube-dl-repository. I have no idea how the interval holds up, it can probably be shorter.

We have blocked your account because our security systems have flagged your Pluralsight account for an unusual amount activity. This does mean a high volume of requests that are in the realm of a request every 10-30 seconds for a prolonged period of time. Please note that this high volume of activity is in violation of our terms of service [https://www.pluralsight.com/terms].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment