Skip to content

Instantly share code, notes, and snippets.

What would you like to do? unfortunately does not allow one to easily download course videos even with a premium subscription. Here, I show you how to easily do that with the open source youtube-dl utility.


youtube-dl is a handy little command-line utility that, with the right command, automagically downloads videos from Youtube as well as other platforms such as Vimeo,, BBC, CNN etc..(Full list of supported websites)

Kindly proceed to youtube-dl's Github repo for detailed installation instructions for your respective OS

In case of an error, make sure you have Python 2.6, 2.7 or 3.2+ installed as youtube-dl needs it to run.


Step One: Log in

Go to the and log in with either your personal/organization account.

Step Two: Cookies.txt

We need a way to let youtube-dl know that you are logged in so that it can download premium videos. youtube-dl allows us to do this by passing through a text file called cookies.txt containing cookies from our browser.

Luckily, there are [Google Chrome](Cookies Export) and Firefox extensions that create the cookies.txt file for you. So, to get us going:

  • Download the extension for your respective browser from the links above.
  • While on the tab with logged in, activate the extension and download your cookies file.
  • Create a folder at a location of your choosing (we'll use this for our downloads) and place your cookies file in the said folder. Ensure your file is named cookies.txt.

Lastly: Download away

  • Open your terminal/cmd app and navigate to the folder with the cookies.txt in Step 2 above.
  • Just one more command to get youtube-dl downloading, as below:
youtube-dl --cookies cookies.txt "" -o " - %(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s" --write-sub

Let's go through the above code:

  • youtube-dl - calls the youtube-dl utility

  • --cookies - allows you to pass your cookies.txt file

  • cookies.txt - link to the cookies.txt file we created in Step 2 above. If you stored the cookies.txt file in another location, make sure you enter the proper relative link to it.

  • "" - replace this with the link for the course you want to download.

  • -o " - %(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s - %(title)s.%(ext)s" - This part solves a big headache. Normally, all the course videos would be lumped in the folder in no particular order.

    This code organises them into Course Name > Chapter Number - Chapter Name > Video Number - Video Title. Perfect order to consume your tutorials.

If you like to tinker & experiment or just want to find out more about youtube-dl options, go through their well-written documentation.


This comment has been minimized.

Copy link

a-vrma commented Oct 21, 2018

Very interesting, but have you tried using Lyndor? Seems to have more features (exercise files, multiple courses, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.