khan-dl
A python script to download courses from Khan Academy using yt-dlp and beautifulsoup4.
Installation
pip install khan-dl -U
Usage
$ khan-dl -h
usage: khan-dl [-h] [-i] [-c COURSE_URL]
optional arguments:
-h, --help show this help message and exit
-i, --interactive Enter Interactive Course Selection Mode
-c COURSE_URL, --course_url COURSE_URL
Enter Course URL
-a, --all Download all Courses from all Domains
- You can download courses interactively on a prompt, which will list all course domains and their respective courses available with tab completion.
$ khan-dl -i
_ __ _ _ _ _ _ ____ _
| |/ /| | | | / \ | \ | | | _ \ | |
| ' / | |_| | / _ \ | \| | _____ | | | || |
| . \ | _ | / ___ \ | |\ ||_____|| |_| || |___
|_|\_\|_| |_|/_/ \_\|_| \_| |____/ |_____|
Domain: Math
Selected Domain: math
Downloading Courses...
Course: Early math
Selected Course: Early math
Course URL: https://www.khanacademy.org/math/early-math
Generating Path Slugs.....
Collecting Youtube IDs: 100.0% [========================================================================================================================================>] 4/ 4 eta [00:00]
Downloading Videos: 0.0% [> ] 0/ 75 eta [?:??:??]
- Download a specific course.
$ khan-dl -c "https://www.khanacademy.org/math/early-math"
_ __ _ _ _ _ _ ____ _
| |/ /| | | | / \ | \ | | | _ \ | |
| ' / | |_| | / _ \ | \| | _____ | | | || |
| . \ | _ | / ___ \ | |\ ||_____|| |_| || |___
|_|\_\|_| |_|/_/ \_\|_| \_| |____/ |_____|
Looking up https://www.khanacademy.org/math/early-math...
Course URL: https://www.khanacademy.org/math/early-math
Generating Path Slugs...
Collecting Youtube IDs: 100.0% [========================================================================================================================================>] 4/ 4 eta [00:00]
Downloading Videos: 0.0% [> ] 0/ 75 eta [?:??:??]
- Download all courses on traditional subjects like Math, Science, Computing, Humanities, Economics-Finance-Domain.
$ khan-dl -a
_ __ _ _ _ _ _ ____ _
| |/ /| | | | / \ | \ | | | _ \ | |
| ' / | |_| | / _ \ | \| | _____ | | | || |
| . \ | _ | / ___ \ | |\ ||_____|| |_| || |___
|_|\_\|_| |_|/_/ \_\|_| \_| |____/ |_____|
Downloading all Courses from all Domains...
Selected Domain: math
Downloading Courses...
Selected Domain: science
Downloading Courses...
Selected Domain: computing
Downloading Courses...
Selected Domain: humanities
Downloading Courses...
Selected Domain: economics-finance-domain
Downloading Courses...
Selected Domain: ela
Downloading Courses...
Course URL: https://www.khanacademy.org/math/early-math
Generating Path Slugs...
Collecting Youtube IDs: 100.0% [========================================================================================================================================>] 4/ 4 eta [00:00]
Downloading Videos: 0.0% [> ] 0/ 75 eta [?:??:??]
Other solutions
Khan Academy is also available for offline usage through these Open Source projects:
Metadata
Release files for khan-dl 1.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| khan_dl-1.2.9.tar.gz | 7.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| khan_dl-1.2.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / khan_dl-1.2.9.tar.gz
| Download URL | khan_dl-1.2.9.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
99f9292f76320c18f8ca7c5988bb91f8b0aad6d6876071564f77b4536b2c750e
|
|
BLAKE2b-256 checksum How to use checksums |
4c4e2de017e369bbd0e0d9c0610b3e38b339a8cf1c0bbf867df4bd991dea7d81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.8 Linux/6.1.84
|
Release files / khan_dl-1.2.9-py3-none-any.whl
| Download URL | khan_dl-1.2.9-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
20f664ecd4c06b0f4c68694ea10f6935550d1dba03078bbf810ee18135e4f3dd
|
|
BLAKE2b-256 checksum How to use checksums |
a8db6be33d805d231b106c365cbd395c7d9747a3ab928b19e139b420326108c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.7.1 CPython/3.11.8 Linux/6.1.84
|