MCPcopy Index your code
hub / github.com/Puyodead1/udemy-downloader

github.com/Puyodead1/udemy-downloader @1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.0 ↗ · + Follow
59 symbols 170 edges 5 files 13 documented · 22% updated 11d ago1.0 · 2021-05-19★ 2,00022 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Udemy Downloader with DRM support

NOTE

This program is WIP, the code is provided as-is and i am not held resposible for any legal repercussions resulting from the use of this program.

Support

if you want help using the program, join my discord server or use github issues

License

All code is licensed under the MIT license

Description

Simple and hacky program to download a udemy course, has support for DRM videos but requires the user to aquire the decryption key (for legal reasons).

Requirements

  1. You would need to download ffmpeg and mp4decrypter from Bento4 SDK and ensure they are in path(typing their name in cmd invokes them).

Usage

quick and dirty how-to

You will need to get a few things before you can use this program:

  • Decryption Key ID
  • Decryption Key
  • Udemy Course ID
  • Udemy Bearer Token

Setting up

  • rename .env.sample to .env
  • rename keyfile.example.json to keyfile.json

Aquire bearer token

  • open dev tools
  • go to network tab
  • in the search field, enter api-2.0/courses
  • Valid udemy api requests
  • click a random request
  • locate the Request Headers section
  • copy the the text after Authorization, it should look like Bearer xxxxxxxxxxx
  • bearer token example
  • enter this in the .env file after UDEMY_BEARER=

Aquire Course ID

  • Follow above before following this
  • locate the request url field
  • request url
  • copy the number after /api-2.0/courses/ as seen highlighed in the above picture
  • enter this in the .env file after UDEMY_COURSE_ID=

Key ID and Key

It is up to you to aquire the key and key id.

  • Enter the key and key id in the keyfile.json
  • keyfile example
  • example key and kid from console

Start Downloading

You can now run python main.py to start downloading. The course will download to out_dir, chapters are seperated into folders.

Getting an error about "Accepting the latest terms of service"?

  • If you are using Udemy business, you must edit main.py and change udemy.com to <portal name>.udemy.com

Credits

  • https://github.com/Jayapraveen/Drm-Dash-stream-downloader - for the original code which this is based on
  • https://github.com/alastairmccormack/pywvpssh - For code related to PSSH extraction
  • https://github.com/alastairmccormack/pymp4parse/ - For code related to mp4 box parsing (used by pywvpssh)

Core symbols most depended-on inside this repo

parse
called by 8
mp4parse.py
extract_kid
called by 4
utils.py
_read_string
called by 4
mp4parse.py
_read_count_and_string_table
called by 4
mp4parse.py
download_media
called by 4
dashdownloader_multisegment.py
download_media
called by 4
main.py
_read_box_header
called by 3
mp4parse.py
_is_mp4
called by 2
mp4parse.py

Shape

Method 23
Function 21
Class 15

Languages

Python100%

Modules by API surface

mp4parse.py38 symbols
main.py10 symbols
dashdownloader_multisegment.py10 symbols
utils.py1 symbols

For agents

$ claude mcp add udemy-downloader \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact