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
Metadata
Release files for async-udemy-dl 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| async-udemy-dl-0.1.1.tar.gz | 9.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_udemy_dl-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.0 kB
Release files / async-udemy-dl-0.1.1.tar.gz
| Download URL | async-udemy-dl-0.1.1.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
19ba2d6110d87b6136dcafa67f367e4fb6a1835151bec3a091830af5531411a8
|
|
BLAKE2b-256 checksum How to use checksums |
a34a3d46252981368f4a55993bf1b867b5955a324312d6edf8d59382043906a6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / async_udemy_dl-0.1.1-py3-none-any.whl
| Download URL | async_udemy_dl-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81a17ed36cb11f337b1e1778789f0087fe0397a8ad73be8be1bbbbe651480254
|
|
BLAKE2b-256 checksum How to use checksums |
1514e77590a3e5a36db1d1dcf3f90b4ff3c31f9e402ead2285b09594fed99b35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for async-udemy-dl 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.