Skip to content

Instantly share code, notes, and snippets.

@skmezanul
Last active December 14, 2017 15:43
Show Gist options
  • Save skmezanul/3e25abd9cca27a579ef475a4ee4f7b1b to your computer and use it in GitHub Desktop.
Save skmezanul/3e25abd9cca27a579ef475a4ee4f7b1b to your computer and use it in GitHub Desktop.
Using youtube-dl to download courses from a famous online developer training site.

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 training site 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 the training site 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 training site

Run the following command in your terminal to download all the videos to the folder you are currently in. Substitute the example credentials with your own and supply a link to the course.

youtube-dl --username "[email protected]" --password "yourPassword" --verbose --sleep-interval 120 "link to course"

Example:

youtube-dl --username "[email protected]" --password "yourPassword" --verbose --sleep-interval 120 "https://app.trainingsite.com/library/courses/javascript-fundamentals/"

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 the training site will ban you because you are doing too many requests under a short period of time.

We have blocked your account because our security systems have flagged your training site 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.

Disclaimer

Please, only use it for your convenience so that you can watch the course videos on your iPod, TV, etc.

Usage for the purpose of piracy is strictly prohibited, decrypted videos should not be uploaded to open servers, torrents, or other methods of mass distribution. Any consequences resulting from misuse of this tool are to be taken by the user.

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