How To Download A Udemy Course: Working

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

How to Download a Udemy Course

Master Branch Steps


Status: WORKING (6/26/2022)
Requirements:
● YOU NEED TO HAVE ALREADY PURCHASED THE COURSE YOU WANT TO DOWNLOAD
● Clone master branch of Udemy Downloader by Puyodead1 repository.
● Request access to GetWVKeys discord server.
● Get your GetWVKeys API Key.
● Download Get key script and save it inside the cloned repository. (You need to join the
GetWVKeys discord server to download this. Also, by the time you are reading this, there might
be an update so just scroll down in the channel and see if there’s any new version.)
● Install Python on your computer.
● Inside the cloned repository create a folder with the name “dependencies”.
● Download and save inside the dependencies folder:
○ ffmpeg
○ aria2c
○ mp4decrypt
○ Yt-dlp
Process:
1. Get your access token for Udemy.
a. Open a course on Google Chrome.
b. Open the developer panel and go to the Application tab.
c. Refresh the page.
d. Search for "access_token"
e. Copy the token to the ".env" file inside the cloned repository. Create the file if it does
not exist.
2. Get your cookies from Udemy (only for Udemy Business).
a. Open a course on Google Chrome.
b. Open the developer panel and go to the Console tab.
c. Refresh the page.
d. Run "document.cookie" command on the bottom input text box.
e. Copy the cookie (text between quotes) to the "cookies.txt" file inside the cloned
repository. Create the file if it does not exist.
3. Get the Media License Token. (You must do steps 3, 4 and 5 quickly because the Media License
Token expires.)
a. Get Media License Token from license path:
b. Open the course on Google Chrome.
c. Open the developer panel and go to the Network tab.
d. Refresh the page.
e. Search for "widevine" using the input box to filter by text.
f.Select an element that starts with a string like
“validate-auth-token?drm_type=widevine&auth_token=” and copy and store to a text
file the "Path" value of Request Header accordion on the right panel. The token is the
text after
"/api-2.0/media-license-server/validate-auth-token?drm_type=widevine&auth_token=".
If you are not seeing an element, the selected lecture does not have DRM. You must try
with another lecture until you find a lecture with DRM.
4. Get MPD URL.
a. Get Media License Token from license path:
b. Open the course on Google Chrome.
c. Open the developer panel and go to the Network tab.
d. Refresh the page.
e. Search for "mpd" using the input box to filter by text.
f. Select an element and copy and store to a text file the "Request URL" value of Generalr
accordion on the right panel. If you are not seeing an element means that the selected
lecture has not DRM. You must try with another lecture until you find a lecture with
DRM.
5. Get Keys with Get key script script.
a. Open a terminal and change the current directory to the cloned repository folder.
b. Run script getwvkeys_udemy3.py from terminal.
c. Input Media License Token.
d. Input MPD URL.
e. Input GetWVKeys API Key.
f. Find the keyid and key right above “DONE” message you will see a bunch of text and in it
somewhere it will say "keys":[{"key":"XXXXXXXXXXXXXXX:XXXXXXXXXXXXXXX"}]”.
g. Copy the keyid and key to the "keyfile.json" file inside the cloned repository. Create the
file if it does not exist.
6. Download the course.
a. Open a terminal and change the current directory to the cloned repository folder.
b. Run the command to install the python dependencies: pip install -r requirements.txt
c. Run the command as a safe measure : pip install xmltodict
d. Put the dependencies folder inside the cloned repository created before in the system
path by going into environmental variables.
e. Run the command to download the course. (More information about the arguments of
the command.). For example: python main.py -c
https://www.udemy.com/course/graphics-with-modern-opengl/learn/lecture/10031110
?start=15#overview --download-assets --download-captions --disable-ipv6 -l en -l es
--log-level DEBUG
f. After the download the course should be in the out_dir folder inside the cloned
repository folder.
Selenium Branch Steps
It worked for me on 6/13/22
Good luck
Requirements:
YOU NEED TO HAVE ALREADY PURCHASED THE COURSE YOU WANT TO DOWNLOAD
Udemy Downloader by Puyodead1 (Selenium Branch worked for me at this moment, but try the master
branch first)
GetWVKeys for the Key and KeyID
ffmpeg
aria2c
mp4decrypt
yt-dlp
Get key script (to make it easier to get the Key and KeyID). You need to join the GetWVKeys discord
server to download this. Also, by the time you are reading this, there might be an update so just scroll
down in the channel and see if there’s any new version.

Steps:
1. Basically follow the steps in the Udemy Downloader on Github
a. Put ffmpeg, aria2c, mp4decrypt, and yt-dlp in the system path (by going into
environmental variables and adding the folders that contain the files).
b. Find your bearer token using the firefox guide or the chrome guide. Edit the config.toml
file and make it look like this:

Make sure to delete the # in front of bearer_token if there is one!


While you’re at it, change disable_ipv6 to true (doing this made it work for me)

Also put your udemy username and password near the end of the file and change
headless to false if you want (I don’t think it’s necessary):

c. I did not find my cookie because I don’t have a subscription, but if you have a
subscription take a look at the cookie section
2. Get the Key ID and Key for your course
a. Go to GetWVKeys and click on “Login with Discord”
b. Join the discord server, read #rules, read #verification-faq, and then create a ticket in
#verification and wait for the admins/mods to give you the green verified role.
Remember one important piece of information: #rules says you cannot share whatever
you download with anyone else. Once you are verified in the discord server, go back to
GetWVKeys.
c. Find your API key by hovering over your username and clicking on Profile

d. Download the Get key script and run the downloaded .py file. You should see something
like this:

To find the media license token, open dev tools in your browser (ctrl+shift+i for chrome)
and click on network.

Go to any video in the udemy course you want to download and reload the page so that
stuff appears in the network tab. Also, make sure that all is selected:

In the search bar, type in “license” (without the quotation marks ofc) and click on the
thing that says something like validate-auth-token?drm… . Scroll down to Request
Headers and look for the :path:. It will say
/api-2.0/media-license-server/validate-auth-token?drm_type=widevine&auth_
token=. Copy everything after the equals sign (only the stuff in :path:, don’t go to
:scheme:). That will be the media license token. Now you must enter the mpd url:
Instead of searching for “license”, just search for “mpd”. Look for index.mpd?token= and
click on it. Then copy everything after Request URL underneath General, but don’t go to
Request Method. This is the MPD URL. Now it will ask for the GetWVkeys api key:

Enter your api key that you found before.

NOTE: THE STUFF TO GET THE KEY MUST BE DONE RELATIVELY QUICKLY OR YOU WILL
GET AN ERROR. IF YOU GET AN ERROR RELOAD THE VIDEO PAGE AND TRY EVERYTHING
AGAIN
e. Find the key and keyid. Right above DONE you will see a bunch of text and in it
somewhere it will say "keys":[{"key":"_____:____"}]. There will be stuff in the blanks.
Copy the stuff in the first blank. Go to keyfile.json in the downloaded selenium branch
and paste that into the first set of quotation marks. The stuff in the second blank will be
copied into the second set of quotation marks. Save keyfile.json and close it.
3. Run the downloaded selenium branch folder stuff
a. In cmd, navigate to the downloaded selenium branch folder and run the command “pip
install -r requirements.txt” (without the quotation marks). Once that’s done just run “pip
install xmltodict” as a safe measure.
b. Find your Udemy course url by going to your udemy course. Make sure it has /learn in it.
An example of the link is
https://www.udemy.com/course/java-the-complete-java-developer-course/learn.
c. To download all the course files (it doesn’t download the captions idk why) run the
command “python main.py -c
https://www.udemy.com/course/java-the-complete-java-developer-course/learn/
--download-assets -sc” but replace the course link with your course link and don’t type
the quotes.
d. Watch as stuff happens.
e. The output course should be in the out_dir folder inside the selenium branch folder you
downloaded from github.

You might also like