Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy


  1. Get link to the course to download. e.g.
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)1 export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
$ youtube-dl --cookies ./udemy-cookies.txt


  • If you have previously installed youtube-dl, you should update it before attempting to download your Udemy courses
    $ youtube-dl -U
  • If you want your videos to be organized by chapter and the indices included, you can specify the output flag -o
    $ youtube-dl --cookies ./udemy-cookies.txt -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'
# List available formats
youtube-dl -u <username> -p <password> -F -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s'
# Download the specified format
youtube-dl -u <username> -p <password> -f <desired-format> -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s'
# Download specific items
youtube-dl <url> --cookies <cookies-filename> --playlist-items "<comma-separated-indices>"
# Skip specific indices
youtube-dl <url> --cookies <cookies-filename> --playlist-start START_NUMBER
Copy link

dirkf commented Apr 27, 2022

See ytdl-org/youtube-dl#30901 and the linked issues.

Copy link

CoderHarshvirSingh commented Aug 30, 2022

Hi @guys, today I've just tried to download course from Udemy using cookies.txt approach and see it's still working fine. Followings are the steps I use to download Udemy course:
Open Chrome and add extension cookies.txt from Genuinous.
Login to Udemy website and click that extension to download cookie file named cookies.txt.
Put this cookie file inside the folder you want to download.
Followings are some examples of cmd to download the course:

# Download with human-generated subtitle.
youtube-dl --write-sub --sub-lang en --cookies cookies.txt -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'

# Download with auto-generated subtitle.
youtube-dl --write-auto-sub --sub-lang en --cookies cookies.txt -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'

NOTE: Make sure there's no /course/ in the url.

Hope it helps. Cheers.

tested with personal account and working fine

its working fine

Copy link

PrajyotGajane commented Aug 31, 2022

@CoderHarshvirSingh how were you able to ?
I ran the same command with another course it, downloaded 2 videos and then it failed, everytime.

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