Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save skmezanul/b873f9d47cf6f3ce94b72f0c3063e097 to your computer and use it in GitHub Desktop.
Save skmezanul/b873f9d47cf6f3ce94b72f0c3063e097 to your computer and use it in GitHub Desktop.
youtube-dl for downloading videos from a popular dev training site

Downloading Videos from the training site

Disclaimer

The training site do not permit users to download their videos.
If you are an user of the site you have agreed with their ToS,
and are thusly refrained from doing so.
Use this knowledge at your own risk.

youtube-dl for Windows

youtube-dl will allow you to download entire video series just by pasting in the link to the course. This includes english subtitles where applicable.

1. Download youtube-dl

You can get it here from their official web-site.

2. Create a bat script file

We need to create bat script that will store all the information we need to quickly and easily download videos from the training site. Create a new text file and name it 'trainingsite.bat'. Put it in the same folder as youtube-dl.exe (from step 1).

3. Paste in the script in the file

for %%a in (%*) do (
.\youtube-dl.exe ^
--username YOUR-USERNAME-HERE ^
--password YOUR-PASSWORD-HERE ^
%%a ^
-o "C:/Users/YOUR-USERNAME-HERE/Videos/[REPLACE-WITH-TRAINING-SITE-NAME]/%%(playlist)s/%%(chapter_number)02d - %%(chapter)s/%%(playlist_index)02d - %%(title)s.%%(ext)s" ^ --sleep-interval 35 ^
--max-sleep-interval 120 ^
--sub-lang en ^
--sub-format srt ^
--write-sub
)

  1. Remember to add your own username, password and the path to where you want the videos to be stored. Replace YOUR-USERNAME-HERE, YOUR-PASSWORD-HERE and YOUR-NAME-HERE.
  2. If you wish to change the formatting of the output video files, you can learn more about it here.

4. Begin downloading videos

In order to run the scripts, you need to open up a command prompt or Windows PowerShell. Navigate to the folder you have the script and youtube-dl.exe. Hold left-shift and right mouse click in the folder, and select 'Open PowerShell Window here' or the 'Command Prompt' equivalent.

All you have to do now in order to download the videos, is to run:

.\trainingsite.bat [URL-HERE]

You can also add multiple URLs, separated by a space:

.\trainingsite.bat [URL1] [URL2] [URL3]

If you open up a text editor (for copy/paste), you can also prepare all your URL in a similar fashion:

trainingsite-dl ^
[URL1] ^
[URL2] ^
[URL3]

URL is usually formatted similar to https://app.trainingsite.com/library/courses/some-course-name


youtube-dl for Linux

youtube-dl will allow you to download entire video series just by pasting in the link to the course. This includes english subtitles where applicable.

1. Download youtube-dl

You can get it here from their official web-site.

2. Create the bash script file

We are going to create bash script that will store all the information we need to quickly and easily download videos. Make sure you save it inside /bin, as it will allow us to run the 'trainingsite-dl' command from anywhere.

sudo touch /usr/local/bin/trainingsite-dl
sudo chmod a+rx /usr/local/bin/trainingsite-dl
sudo nano /usr/local/bin/trainingsite-dl

3. Paste in the script

#!/bin/bash
for i in "$@";
do

youtube-dl
--username YOUR-USERNAME-HERE
--password YOUR-PASSWORD-HERE
"$i"
-o "/home/YOUR-USERNAME-HERE/Videos/%(playlist)s/%(chapter_number)02d - %(chapter)s/%(playlist_index)02d - %(title)s.%(ext)s"
--sleep-interval 35
--max-sleep-interval 120
--sub-lang en
--sub-format srt
--write-sub

done

  1. Remember to add your own username, password and the path to where you want the videos to be stored. Replace YOUR-USERNAME-HERE, YOUR-PASSWORD-HERE and YOUR-NAME-HERE.
  2. If you wish to change the formatting of the output video files, you can learn more about it here.

3. Begin downloading videos

All you have to do now in order to download videos, is to run:

trainingsite-dl [URL-HERE]

You can also add multiple URLs, separated by a space:

trainingsite-dl [URL1] [URL2] [URL3]

If you open up a text editor (for copy/paste), you can also prepare all your URL in a similar fashion:

trainingsite-dl \
[URL1] \
[URL2] \
[URL3]

URL is usually formatted similar to https://app.trainingsite.com/library/courses/some-course-name

@mahdisky
Copy link

how to get multi caption auto?

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