simple script to asynchronously download udemy course
Project description
udemy-dl
Goals
A python script using asyncio to speedup downloading for Chinese udemy users who cannot watch video online because of China GFW
Thanks
This project is based on udemy-dl and adds asyncio support to it.
Features
- Asynchronously download course videos.
- Resume capability for a course video.
- Download specific chapter in a course (option:
-c / --chapter
). - Download specific lecture in a chapter (option:
-l / --lecture
). - Download chapter(s) by providing range in a course (option:
--chapter-start, --chapter-end
). - Download lecture(s) by providing range in a chapter (option:
--lecture-start, --lecture-end
). - Download course to user requested path (option:
-o / --output
).
Requirements
-
Python>=3.7
-
requests
-
aiohttp
Download async-udemy-dl
You can download the latest version of async-udemy-dl by cloning the GitHub repository.
git clone https://github.com/Firkraag/async-udemy-dl
Pip install
pip install async-udemy-dl
After installation, pip will install a script named async-udemy-dl
in your executable path, so async-udemy-dl
can replace python async-udemy-dl.py
in the Usage section.
Usage
This project uses cookies to authenticate with, so you must specify cookie file on commandline with option -k cookies_file
.
Please follow Extracting Cookies / Request Headers to save udemy cookies to files before using this script.
Download a course
python async-udemy-dl.py -k COOKIES_FILE COURSE_URL
Download course to a specific location
python async-udemy-dl.py -k COOKIES_FILE COURSE_URL -o "/path/to/directory/"
Download specific chapter from a course
python async-udemy-dl.py -k COOKIES_FILE COURSE_URL -c NUMBER
Download specific lecture from a chapter
python async-udemy-dl.py -k COOKIES_FILE COURSE_URL -c NUMBER -l NUMBER
Download lecture(s) range from a specific chapter
python async-udemy-dl.py COURSE_URL -k COOKIES_FILE -c NUMBER --lecture-start NUMBER --lecture-end NUMBER
Download chapter(s) range from a course
python async-udemy-dl.py COURSE_URL -k COOKIES_FILE --chapter-start NUMBER --chapter-end NUMBER
Download specific lecture from chapter(s) range
python async-udemy-dl.py COURSE_URL -k COOKIES_FILE --chapter-start NUMBER --chapter-end NUMBER --lecture NUMBER
Download lecture(s) range from chapter(s) range
python async-udemy-dl.py COURSE_URL -k COOKIES_FILE --chapter-start NUMBER --chapter-end NUMBER --lecture-start NUMBER --lecture-end NUMBER
Extracting Cookies / Request Headers
-
Login to your udemy account via browser.
-
Once you are logged in right click on page the search for option called Inspect Element and click on that.
-
Under that look for Network Tab and click on that. Under that Network Tab click on Requests type XHR .
-
Now click on My Courses in the Udemy navbar and refresh the page you will see some requests under Network Tab.
-
Right click on request links to udemy.com/api-2.0/. Simply copy Request Headers and save to text file.
-
The above guide is for Firefox users. Chrome Users can follow guide by @lamlephamngoc.
-
Done run the async-udemy-dl against that text file it will start downloading the course.
Advanced Usage
Author: Firkraag (Firkraag)
usage: async-udemy-dl.py [-h] [-v] -k cookie_file [-d] [-o] [-c] [-l]
[--chapter-start] [--chapter-end] [--lecture-start]
[--lecture-end] course
A cross-platform python based utility to download courses from udemy for
personal offline use.
positional arguments:
course Udemy course.
General:
-h, --help Shows the help.
-v, --version Shows the version.
Authentication:
-k , --cookies cookies_file Cookies to authenticate with.
Advance:
-d, --debug output debug info to screen
-o , --output Download to specific directory, if not specified, download to current directory.
-c , --chapter Download specific chapter from course.
-l , --lecture Download specific lecture from chapter(s).
--chapter-start Download from specific position within course.
--chapter-end Download till specific position within course.
--lecture-start Download from specific position within chapter(s).
--lecture-end Download till specific position within chapter(s).
Example:
python async-udemy-dl.py COURSE_URL -k cookies.txt
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file async-udemy-dl-0.1.1.tar.gz
.
File metadata
- Download URL: async-udemy-dl-0.1.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19ba2d6110d87b6136dcafa67f367e4fb6a1835151bec3a091830af5531411a8 |
|
MD5 | c64e35fe9fc791787179ce03d179a284 |
|
BLAKE2b-256 | a34a3d46252981368f4a55993bf1b867b5955a324312d6edf8d59382043906a6 |
File details
Details for the file async_udemy_dl-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: async_udemy_dl-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81a17ed36cb11f337b1e1778789f0087fe0397a8ad73be8be1bbbbe651480254 |
|
MD5 | 816c90875d3bc6179bdae6069f60f854 |
|
BLAKE2b-256 | 1514e77590a3e5a36db1d1dcf3f90b4ff3c31f9e402ead2285b09594fed99b35 |