A cross-platform utility written in Rust to download courses from udemy for personal offline use.
- List down course contents and video resolution (option:
info
). - Download specific chapter in a course (option:
-c / --chapter
). - Download specific lecture in a chapter (option:
-l / --lecture
). - Automatically pickup the best resolution for video download.
- Download lecture(s) requested resolution (option:
-q / --quality
). - Download course to user requested path (option:
-o / --output
). - Mark complete chapters or individual lectures as complete.
- Authentication token (option:
-t / --access-token
).
Authentication is only supported via the usage of an Access Token. The following paragraph details how to obtain such a token.
- Open developer tools on your browser and access the Network Tab.
- Login to your udemy account.
- Check the network tab, you can filter on XHR requests to make the following easier.
- Right click on request links to udemy.com/api-2.0/. Check the request cookies and find one named access_token. Copy its value. This is your access token.
udemy-dl-rs -u COURSE_URL -t YourAccessToken info
udemy-dl-rs -u COURSE_URL -t YourAccessToken download
udemy-dl-rs -u COURSE_URL -t YourAccessToken download -o ~/Downloads
udemy-dl-rs -u COURSE_URL -t YourAccessToken download -o ~/Downloads -q 720
udemy-dl-rs -u COURSE_URL -t YourAccessToken download -o ~/Downloads -c 1
udemy-dl-rs -u COURSE_URL -t YourAccessToken download -o ~/Downloads -c 8 -l 77
Note: The lecture number is it's index in the overall course. Use info to know more.
$ udemy-dl-rs --help
Udemy Downloader 0.10.0
Bernard Niset
USAGE:
udemy-dl-rs [FLAGS] --access-token <TOKEN> --url <URL> <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
-v Sets the level of verbosity
OPTIONS:
-t, --access-token <TOKEN> Access token to authenticate to udemy
-u, --url <URL> URL of the course to download
SUBCOMMANDS:
complete Mark courses as completed
download Download course content
help Prints this message or the help of the given subcommand(s)
info Query course information
Build: 814815c - 2019-09-07
$ udemy-dl-rs info --help
udemy-dl-rs-info
Query course information
USAGE:
udemy-dl-rs --password <PASSWORD> --url <URL> --username <USERNAME> info
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
$ udemy-dl-rs download --help
udemy-dl-rs-download
Download course content
USAGE:
udemy-dl-rs --password <PASSWORD> --url <URL> --username <USERNAME> download [FLAGS] [OPTIONS]
FLAGS:
-d, --dry-run Dry run, show what's would be done but don't download anything.
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --chapter <CHAPTER> Restrict downloads to a specific chapter.
-l, --lecture <LECTURE> Restrict download to a specific lecture.
-o, --output <OUTPUT_DIR> Directory where to output downloaded files (default to .). [default: .]
-q, --quality <QUALITY> Download specific video quality.
$ udemy-dl-rs complte --help
udemy-dl-rs-complete
Mark courses as completed
USAGE:
udemy-dl-rs --password <PASSWORD> --url <URL> --username <USERNAME> complete [OPTIONS] --chapter <CHAPTER>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-c, --chapter <CHAPTER> Restrict marking a specific chapter.
-l, --lecture <LECTURE> Restrict marking a specific lecture.
- Resume capability for a course video.
- Supports organization and individual udemy users both.
- Download subtitles for a video.
- Download chapter(s) by providing range in a course.
- Download lecture(s) by providing range in a chapter.
Install cargo watch
cargo install cargo-watch
Run unit tests. Unit tests need to run single threaded.
cargo test -- --test-threads=1
Run unit tests with watch
cargo watch -w src -x "test -- --test-threads=1"
cargo run -- -u https://www.udemy.com/css-the-complete-guide-incl-flexbox-grid-sass -t YourAccessToken info
cargo run -- -u https://www.udemy.com/css-the-complete-guide-incl-flexbox-grid-sass -t YourAccessToken download -c 1
cargo run -- -u https://www.udemy.com/css-the-complete-guide-incl-flexbox-grid-sass -t YourAccessToken download -c 1 -o ~/Downloads