Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save funky-monkey/c8e87995cd91314cd1c7990d519de4e9 to your computer and use it in GitHub Desktop.
Save funky-monkey/c8e87995cd91314cd1c7990d519de4e9 to your computer and use it in GitHub Desktop.
Downloading Udemy videos with youtube-dl

Download Udemy course videos using youtube-dl

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

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from Firefox (cookies.txt)1 export extension. Save it to file cookies.txt

$ youtube-dl https://www.udemy.com/course-name/ --cookies ./cookies.txt $ youtube-dl -u username -p password -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name --cookies ./cookies.txt --verbose

# List available formats
youtube-dl -u <username> -p <password> -F -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name/
# 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' https://www.udemy.com/course-name/
# 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
# Download range of videos
youtube-dl <url> --cookies <cookies-filename> --playlist-items STARTRANGE-ENDRANGE
# Add user agent (add this to above examples)
--user-agent 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A403 Safari/8536.25'
# Add verbosity (add this to above examples)
--verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment