• Stars
    star
    1,257
  • Rank 37,142 (Top 0.8 %)
  • Language
    Python
  • License
    MIT License
  • Created over 3 years ago
  • Updated 22 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Udemy downloader that can download courses, with DRM support.

Udemy Downloader with DRM support

forthebadge forthebadge forthebadge forthebadge GitHub forks GitHub Repo stars GitHub

NOTE

  • This tool will not work without decryption keys. Do not bother installing unless you already have keys or can obtain them!
  • Downloading courses is against Udemy's Terms of Service, I am NOT held responsible for your account getting suspended as a result from the use of this program!
  • This program is WIP, the code is provided as-is and I am not held resposible for any legal issues resulting from the use of this program.

Description

Utility script to download Udemy courses, has support for DRM videos but requires the user to acquire the decryption key (for legal reasons).
Windows is the primary development OS, but I've made an effort to support Linux also (Mac untested).

Requirements

The following are a list of required third-party tools, you will need to ensure they are in your systems path and that typing their name in a terminal invokes them.

Note: These are seperate requirements that are not installed with the pip command! You will need to download and install these manually!

  • ffmpeg - This tool is also available in Linux package repositories
  • aria2/aria2c - This tool is also available in Linux package repositories
  • shaka-packager
  • yt-dlp - This tool is also available in Linux package repositories, but can also be installed using pip if desired (pip install yt-dlp)

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 URL
  • Udemy Bearer Token (aka acccess token for udemy-dl users)
  • Udemy cookies (only required for subscription plans - see Udemy Subscription Plans)

Setting up

  • rename .env.sample to .env (you only need to do this if you plan to use the .env file to store your bearer token)
  • rename keyfile.example.json to keyfile.json

Acquire Bearer Token

  • Firefox: Udemy-DL Guide
  • Chrome: Udemy-DL Guide
  • If you want to use the .env file to store your Bearer Token, edit the .env and add your token.

Key ID and Key

It is up to you to acquire the key and key ID. Please DO NOT ask me for help acquiring these, decrypting DRM protected content can be considered piracy. The tool required for this has already been discused in a GitHub issue.

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

Start Downloading

You can now run the program, see the examples below. The course will download to out_dir.

Udemy Subscription Plans

You will need to use a different branch of the program, please see feat/cookies.

Advanced Usage

usage: main.py [-h] -c COURSE_URL [-b BEARER_TOKEN] [-q QUALITY] [-l LANG] [-cd CONCURRENT_DOWNLOADS] [--disable-ipv6] [--skip-lectures] [--download-assets] [--download-captions] [--keep-vtt] [--skip-hls]
               [--info] [--id-as-course-name] [-sc] [--save-to-file] [--load-from-file] [--log-level LOG_LEVEL] [--use-h265] [--h265-crf H265_CRF] [--h265-preset H265_PRESET] [--use-nvenc] [-v]

Udemy Downloader

options:
  -h, --help            show this help message and exit
  -c COURSE_URL, --course-url COURSE_URL
                        The URL of the course to download
  -b BEARER_TOKEN, --bearer BEARER_TOKEN
                        The Bearer token to use
  -q QUALITY, --quality QUALITY
                        Download specific video quality. If the requested quality isn't available, the closest quality will be used. If not specified, the best quality will be downloaded for each lecture
  -l LANG, --lang LANG  The language to download for captions, specify 'all' to download all captions (Default is 'en')
  -cd CONCURRENT_DOWNLOADS, --concurrent-downloads CONCURRENT_DOWNLOADS
                        The number of maximum concurrent downloads for segments (HLS and DASH, must be a number 1-30)
  --disable-ipv6        If specified, ipv6 will be disabled in aria2
  --skip-lectures       If specified, lectures won't be downloaded
  --download-assets     If specified, lecture assets will be downloaded
  --download-captions   If specified, captions will be downloaded
  --keep-vtt            If specified, .vtt files won't be removed
  --skip-hls            If specified, hls streams will be skipped (faster fetching) (hls streams usually contain 1080p quality for non-drm lectures)
  --info                If specified, only course information will be printed, nothing will be downloaded
  --id-as-course-name   If specified, the course id will be used in place of the course name for the output directory. This is a 'hack' to reduce the path length
  -sc, --subscription-course
                        Mark the course as a subscription based course, use this if you are having problems with the program auto detecting it
  --save-to-file        If specified, course content will be saved to a file that can be loaded later with --load-from-file, this can reduce processing time (Note that asset links expire after a certain
                        amount of time)
  --load-from-file      If specified, course content will be loaded from a previously saved file with --save-to-file, this can reduce processing time (Note that asset links expire after a certain amount of
                        time)
  --log-level LOG_LEVEL
                        Logging level: one of DEBUG, INFO, ERROR, WARNING, CRITICAL (Default is INFO)
  --use-h265            If specified, videos will be encoded with the H.265 codec
  --h265-crf H265_CRF   Set a custom CRF value for H.265 encoding. FFMPEG default is 28
  --h265-preset H265_PRESET
                        Set a custom preset value for H.265 encoding. FFMPEG default is medium
  --use-nvenc           Whether to use the NVIDIA hardware transcoding for H.265. Only works if you have a supported NVIDIA GPU and ffmpeg with nvenc support
  -v, --version         show program's version number and exit
  • Passing a Bearer Token and Course ID as an argument
    • python main.py -c <Course URL> -b <Bearer Token>
    • python main.py -c https://www.udemy.com/courses/myawesomecourse -b <Bearer Token>
  • Download a specific quality
    • python main.py -c <Course URL> -q 720
  • Download assets along with lectures
    • python main.py -c <Course URL> --download-assets
  • Download assets and specify a quality
    • python main.py -c <Course URL> -q 360 --download-assets
  • Download captions (Defaults to English)
    • python main.py -c <Course URL> --download-captions
  • Download captions with specific language
    • python main.py -c <Course URL> --download-captions -l en - English subtitles
    • python main.py -c <Course URL> --download-captions -l es - Spanish subtitles
    • python main.py -c <Course URL> --download-captions -l it - Italian subtitles
    • python main.py -c <Course URL> --download-captions -l pl - Polish Subtitles
    • python main.py -c <Course URL> --download-captions -l all - Downloads all subtitles
    • etc
  • Skip downloading lecture videos
    • python main.py -c <Course URL> --skip-lectures --download-captions - Downloads only captions
    • python main.py -c <Course URL> --skip-lectures --download-assets - Downloads only assets
  • Keep .VTT caption files:
    • python main.py -c <Course URL> --download-captions --keep-vtt
  • Skip parsing HLS Streams (HLS streams usually contain 1080p quality for Non-DRM lectures):
    • python main.py -c <Course URL> --skip-hls
  • Print course information only:
    • python main.py -c <Course URL> --info
  • Specify max number of concurrent downloads:
    • python main.py -c <Course URL> --concurrent-downloads 20
    • python main.py -c <Course URL> -cd 20
  • Cache course information:
    • python main.py -c <Course URL> --save-to-file
  • Load course cache:
    • python main.py -c <Course URL> --load-from-file
  • Change logging level:
    • python main.py -c <Course URL> --log-level DEBUG
    • python main.py -c <Course URL> --log-level WARNING
    • python main.py -c <Course URL> --log-level INFO
    • python main.py -c <Course URL> --log-level CRITICAL
  • Use course ID as the course name:
    • python main.py -c <Course URL> --id-as-course-name
  • Encode in H.265:
    • python main.py -c <Course URL> --use-h265
  • Encode in H.265 with custom CRF:
    • python main.py -c <Course URL> --use-h265 -h265-crf 20
  • Encode in H.265 with custom preset:
    • python main.py -c <Course URL> --use-h265 --h265-preset faster
  • Encode in H.265 using NVIDIA hardware transcoding:
    • python main.py -c <Course URL> --use-h265 --use-nvenc

If you encounter errors while downloading such as

errorCode=1 Network problem has occurred. cause:Unknown socket error 10051 (0x2743)

or

errorCode=1 Network problem has occurred. cause:A socket operation was attempted to an unreachable network.

Then try disabling ipv6 in aria2 using the --disable-ipv6 option

Support

if you want help using the program, join my Discord server or use GitHub Issues

Credits

License

All code is licensed under the MIT license

and finally, donations!

Woo, you made it this far!

I spend a lot of time coding things, and almost all of them are for nothing in return. When theres a lot of use of a program I make, I try to keep it updated, fix bugs, and even implement new features! But after a while, I do run out of motivation to keep doing it. If you like my work, and can help me out even a little, it would really help me out. If you are interested, you can find all the available options here. Even if you don't, thank you anyways!

More Repositories

1

wv-netflix-extension

Chrome extension to assist with ripping Widevine protected content from Netflix.
JavaScript
32
star
2

powercord-stafftags

JavaScript
25
star
3

wv-backend-downloader

Node.JS Express server for downloading DRM protected content from various streaming sites,
JavaScript
19
star
4

wv-hbomax-extension

Chrome extension to assist with ripping Widevine protected content from HBOMax.
JavaScript
16
star
5

wv-cbs-downloader

Widevine Paramount+/CBS content downloader
JavaScript
13
star
6

wv-peacock-downloader

JavaScript
12
star
7

KaksyxteLauncher

A faithful resurrection of Minecraft Launcher from Q2 2010.
Java
12
star
8

udemy-dl-go

A WIP Udemy downloader written in Go
Go
12
star
9

Run8-V3-reverse-engineering

Information related to Run8 V3s file formats and other things intended for modding
C#
11
star
10

wv_cdm_gen_troll

Widevine CDM generator troll
Python
11
star
11

wv-hulu-extension

Chrome extension to assist with ripping Widevine protected content from Hulu.
JavaScript
10
star
12

widevine-l1-rick-cdm

yes
10
star
13

pyudemy

Python library for interacting with the Udemy API
Python
8
star
14

wv-tubi-downloader

Widevine Tubi content downloader
JavaScript
7
star
15

Run8IndustryConfigEditor

An external, standalone application for editing Run8 Industry Configurations
C#
6
star
16

SpigotServerBuilder

Java application that download BuildTools, compiles, and executes Spigot to create a full Spigot Server!
Java
6
star
17

Discord-Sticker-Downloader

Downloads Discord stickers and converts them to gifs
JavaScript
4
star
18

WoofOS

Public repository for the Woof discord bot
TypeScript
4
star
19

pluto-downloader

Python
4
star
20

WistiaEmbedDownloader

Got sick of copy and pasting wistia codes and crap, so i made a program to do it for me!
Java
3
star
21

SADAROSS

Automated Scam Site Finder
JavaScript
3
star
22

replugged-stafftags

TypeScript
3
star
23

HeistProject

Decompiled and Fixed version of HeistProject GTAV mod
C#
3
star
24

jff-ripper

An addon for WKS-KEY
Python
3
star
25

ClickUp-Webhook-for-Discord

Get ClickUp Updates in your Discord Server!
JavaScript
3
star
26

ClickUp-Discord-Bot

Create & Update ClickUp Tasks from Discord!
JavaScript
3
star
27

spacebar-remote-auth-server

POC remote auth server for fosscord
TypeScript
3
star
28

Run8ModdingToolkit2

Program for working with Run8 content files
C#
2
star
29

artstation-downloader

download artwork from artstation
JavaScript
2
star
30

spacebar-server-monorepo

Monorepo for Spacebar Server
TypeScript
2
star
31

SFUnpacker

C++
2
star
32

CGCookieDownloader

Downloads courses from CGCookie
JavaScript
2
star
33

NetherRoofProtect

Updated version of NetherRoofProtect that works on 1.12.2 servers (https://dev.bukkit.org/projects/netherroofprotect)
Java
1
star
34

CoC-bot

CoC Discord Bot
TypeScript
1
star
35

replugged-noreplymention

Disables the mention by default in replies
TypeScript
1
star
36

GTA-V-Scripts

decompiled and annotated scripts from GTAV
C
1
star
37

replugged-reviewdb

TypeScript
1
star
38

widevine-l3-decryptor

JavaScript
1
star
39

MeteorServerScanner

fork of serverseeker but for mc server scanner
Java
1
star
40

fossbot

fosscord bot, idk
TypeScript
1
star
41

android_device_samsung_j3toplteue

Makefile
1
star
42

applemusic-ripper

An addon for WKS-Key
Python
1
star
43

MiscStuff

Fabric Mod that adds miscellaneous things which are too small for their own mod
Java
1
star
44

replugged-pomelo

DO I HAVE POMELO YET?!?!?!?!?!?!!
TypeScript
1
star
45

Run8TextureTool

C#
1
star
46

Run8ModdingToolkit

C#
1
star
47

deezer-js

JavaScript
1
star
48

fosscord-server-go

unofficial version of fosscord in go
Go
1
star
49

YADB

Yet Another Discord Bot
TypeScript
1
star
50

replugged-platformindicators

TypeScript
1
star
51

artstation-learning-ripper

An addon for WKS-KEY
Python
1
star
52

Run8ModelTool

C#
1
star
53

android_platform_j3toplteue

Platform source for J3 2018 Unlocked (j3toplteue)
Java
1
star
54

EnchantCrystals

Removes the need for anvils, uses crystals to instantly apply enchants! - Requested Plugin
Java
1
star
55

UniversalPatcher

An offline binary patching system
C#
1
star
56

SADAROSS2

Semi Automated Detection And Reporting Of Scam Sites
JavaScript
1
star