Instantly share code, notes, and snippets.

Embed
What would you like to do?
Downloading Udemy videos with youtube-dl

How to download your Udemy course videos using youtube-dl

$ youtube-dl --list-extractors | grep udemy

Steps

  1. Get link to the course to download. e.g. https://www.udemy.com/course-name/
  2. Login into udemy website, save the cookie from chrome using Chrome (Cookie.txt)1 export extension. Save it to file udemy-cookies.txt
  3. Get the link of the video that you want to download. usually in format. Use the command provided below where you have to replace the {course_link} and {path_to_cookies_file} with respective paths.
$ youtube-dl {course_link} --cookies {path_to_cookies_file}
$ youtube-dl --cookies ./udemy-cookies.txt https://www.udemy.com/course-name/

Notes

  • If you have previously installed youtube-dl, you should update it before attempting to download your Udemy courses
    $ youtube-dl -U
    
  • If you want your videos to be organized by chapter and the indices included, you can specify the output flag -o
    $ youtube-dl --cookies ./udemy-cookies.txt -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s' https://www.udemy.com/course-name/
    
# List available formats
youtube-dl -u <username> -p <password> -F -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name/
# Download the specified format
youtube-dl -u <username> -p <password> -f <desired-format> -o './videos/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/course-name/
# Download specific items
youtube-dl <url> --cookies <cookies-filename> --playlist-items "<comma-separated-indices>"
# Skip specific indices
youtube-dl <url> --cookies <cookies-filename> --playlist-start START_NUMBER
@ds2k5

This comment has been minimized.

Copy link

ds2k5 commented Sep 1, 2017

Hi,
you can do this if you want to download the hole course Videos

youtube-dl -u USERNAME -p PASSWORD UDEMY-Course-URL/.../content

@ibro45

This comment has been minimized.

Copy link

ibro45 commented Nov 19, 2017

Thanks a lot! It is important to note that youtube-dl should be updated to the latest version, it didn't work for me until i reinstalled it manually.

@codeangler

This comment has been minimized.

Copy link

codeangler commented Nov 24, 2017

The following will:

  1. download to the folder you are running the command from
  2. run on windows
  3. put a sequential number in front of each course title 001-999

You will need to

  1. put in your uDemy email address
  2. put in your uDemy password
  3. replace the example url at the end of this code snippet with one you've purchased
youtube-dl -u string@gmail.com -p passwordstring -o "./%(playlist)s/%(chapter_number)s-%(chapter)s/%(autonumber)03d-%(title)s.%(ext)s" https://www.udemy.com/the-complete-elixir-and-phoenix-bootcamp-and-tutorial/learn/v4/content
@marwankous

This comment has been minimized.

Copy link

marwankous commented Nov 26, 2017

Is it possible to download paid courses for free?

@ChongWng

This comment has been minimized.

Copy link

ChongWng commented Nov 28, 2017

@marwankous Obviously you can't. Courses will be downloaded from your own udemy account.

@PorkChopExpress86

This comment has been minimized.

Copy link

PorkChopExpress86 commented Dec 10, 2017

This is excellent! I can not take all of my courses where ever I go. Great work guys!

@shuboy2014

This comment has been minimized.

Copy link

shuboy2014 commented Dec 12, 2017

It says,

[generic] ?next=/nginx-fundamentals/learn/v4/content: Downloading webpage
[generic] ?next=/nginx-fundamentals/learn/v4/content: Extracting information
ERROR: Unsupported URL: https://www.udemy.com/?next=%2Fnginx-fundamentals%2Flearn%2Fv4%2Fcontent
@meetajhu

This comment has been minimized.

Copy link

meetajhu commented Dec 13, 2017

@shuboy2014

Your url should be https://www.udemy.com/nginx-fundamentals/

Example:-

youtube-dl https://www.udemy.com/nginx-fundamentals/ --cookies yourcookiesfile.txt

@imthecapedbaldy

This comment has been minimized.

Copy link

imthecapedbaldy commented Jan 20, 2018

Wow i just found this after i've downloaded with no other options. 309 videos. Gigabytes of data. Downloaded, UN-ORGANIZED. Welp thanks for this. By the way is it necessary or safer to wrap the username and password in anything? Like quotation marks or whatsoever.

@tiderdev

This comment has been minimized.

Copy link

tiderdev commented Jan 29, 2018

hello, i tried to use this way to download my enrolled course but it says => Unable to download webpage: <urlopen error [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)> (caused by URLError(SSLError(1, u'[SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)'),))

what did i do wrong?

i use this command:

youtube-dl -u string@gmail.com -p 'mypassword' -o "./%(playlist)s/%(chapter_number)s-%(chapter)s/%(autonumber)03d-%(title)s.%(ext)s" https://www.udemy.com/elasticsearch101/learn/v4/content

@taymourniazi

This comment has been minimized.

Copy link

taymourniazi commented Feb 3, 2018

I try downloading it throuh python spyder. it shows me error syntax. so i tried direct from anaconda prompt and this really works thanks @codeangelar

@kmaslam

This comment has been minimized.

Copy link

kmaslam commented Mar 9, 2018

Is there a way I could download udemy videos from udemy for business? The custom URL is like mycompany.udemy.com but youtube-dL is not taking it..

@mohit2494

This comment has been minimized.

Copy link

mohit2494 commented Mar 24, 2018

Is there a way that youtube-dl arranges the videos in folders as per the sections in the udemy courses ?

@crivatg

This comment has been minimized.

Copy link

crivatg commented Apr 1, 2018

youtube-dl -u your_email -p 'your_password' -f 'best' https://www.udemy.com/yourcourse -o '%(playlist)s/%(chapter_number)s. %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s'

@francishero

This comment has been minimized.

Copy link

francishero commented Apr 22, 2018

i used this one! really really good https://github.com/FaisalUmair/udemy-downloader-gui

@AdilAhmedunar

This comment has been minimized.

Copy link

AdilAhmedunar commented Apr 26, 2018

How can i download IDM ??

@kejsiStruga

This comment has been minimized.

Copy link

kejsiStruga commented Apr 27, 2018

Please how can we download udemy business video, tried prepending /learn/v4 but still wont accept the url format.
Thanks!

@nara20

This comment has been minimized.

Copy link

nara20 commented Apr 29, 2018

Hi,

Using the command line \youtube-dl --cookies Cookies.txt https://www.udemy.com/70473-azure/learn/v4/content I have the following error : "ERROR : No video formats found"
See also attached file.

udemy
Regards,
Nara20

@duckyvirus

This comment has been minimized.

Copy link

duckyvirus commented May 3, 2018

I was getting the same as Nara20. then I updated to 2018.05.01 and now I get a 403: Forbidden error

@SylaCha

This comment has been minimized.

Copy link

SylaCha commented May 6, 2018

I met this error, and What should I do next for fixing this problem? Please kindly help me!

31914322_187196025242431_4160606184811790336_n

image

@CesarBarros

This comment has been minimized.

Copy link

CesarBarros commented May 19, 2018

Now I am able to download the videos again.
For me the solution was:

$ sudo youtube-dl -U
$ Password:
Updating to version 2018.05.18 ...
Updated youtube-dl. Restart youtube-dl to use the new version.

$ youtube-dl --version
2018.05.18

$ youtube-dl --cookies ./udemy-cookies.txt -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s' https://www.udemy.com/course-name/
@Laksmi1940

This comment has been minimized.

Copy link

Laksmi1940 commented May 23, 2018

Hi, how to save the Cookie.txt?? Where I can get that cookie. Can you help me please?? In Chrome browser there is no option for cookie.

@adhikar

This comment has been minimized.

Copy link

adhikar commented May 26, 2018

youtube-dl is not working -see error below
PS D:> youtube-dl https://harbingergroup.udemy.com/azure-deploying-virtual-machines/learn/v4/
[generic] v4: Requesting header
WARNING: Could not send HEAD request to https://udemy.com/azure-deploying-virtual-machines/learn/v4/: HTTP Error 403: Unauthorized
[generic] v4: Downloading webpage
ERROR: Unable to download webpage: HTTP Error 403: Unauthorized (caused by <HTTPError 403: 'Unauthorized'>); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.

@suryastef

This comment has been minimized.

Copy link

suryastef commented Jun 12, 2018

how to download whole course with attached files and web page?
all this time I use this, just downloading videos and subs:
$ youtube-dl --verbose --write-sub --cookies ./udemy-cookies.txt -f best -o '%(playlist)s/%(chapter_number)s - %(chapter)s/%(playlist_index)s. %(title)s.%(ext)s' https://www.udemy.com/course-name/

@atalakey

This comment has been minimized.

Copy link

atalakey commented Jun 14, 2018

Anyone knows how to download courses from a Udemy for business account?

EX. youtube-dl -v -u username -p password -o '~/somefolder/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://company.udemy.com/course_name/

@spidy95

This comment has been minimized.

Copy link

spidy95 commented Jun 16, 2018

How to download specific section of videos in udemy course content

@tiendungitd

This comment has been minimized.

Copy link

tiendungitd commented Jun 25, 2018

it not work with udemy business. I'm using 2018.06.25 version
[generic] terraform-beginner-to-advanced: Requesting header WARNING: Could not send HEAD request to https://aaaa.udemy.com/terraform-beginne r-to-advanced/: HTTP Error 403: Unauthorized [generic] terraform-beginner-to-advanced: Downloading webpage ERROR: Unable to download webpage: HTTP Error 403: Unauthorized (caused by HTTPE rror()); please report this issue on https://yt-dl.org/bug . Make sure you are u sing the latest version; type youtube-dl -U to update. Be sure to call youtube -dl with the --verbose flag and include its complete output.

@Muhammadbarznji

This comment has been minimized.

Copy link

Muhammadbarznji commented Jul 17, 2018

thank you so much 👍 :)

@samme4life

This comment has been minimized.

Copy link

samme4life commented Jul 24, 2018

Hi All,
This is a very useful tool. I have downloaded a massive course using the method @codeangler suggested.
However, I got the following error when downloading 325th lecture,

disconnected

Does anybody know how to download from certain chapter/section or certain video onwards?

Please help

Regards
Samme

@julietezekwe

This comment has been minimized.

Copy link

julietezekwe commented Aug 6, 2018

I am getting this error that the course is not free that I pay for it but I already purchased the course
Course 1362070 is not free. You have to pay for it before you can download. Use this URL to confirm purchase: https://www.udemy.com/cart/checkout/express/course/1362070/?discountCode=1808UDEMYBESTSELLERS

I need help

@ZahreddineSoualem

This comment has been minimized.

Copy link

ZahreddineSoualem commented Sep 1, 2018

how can ai download my courses using new update of youtube-dl ?? can anyone helps me ?

@kaanpoyrazz

This comment has been minimized.

Copy link

kaanpoyrazz commented Sep 4, 2018

udemy coupons website : https://www.99udemycoupon.com/

@adambergquist

This comment has been minimized.

Copy link

adambergquist commented Dec 10, 2018

Hey all, I just got this working for udemy and wanted to post my solution.

First, the username and password are no longer used and must be passed using a cookie.

To get the cookie data, use your browser's developer tools. Select the network tab and filter for "start". You can probably use other elements but this is what I used. For the "start" element look at the header info. Under request headers look at the raw cookie data. Build the cookie into netscape format. I used https://crdx.org/cookies/ but a google search should find an online utility. Create a text file and point to it with the --cookie command. My youtube-dl example is below. Hope this helps!

youtube-dl --cookie ~/cookie_udemy -o './udemy/%(playlist)s/%(chapter_number)s - %(chapter)s/%(title)s.%(ext)s' https://www.udemy.com/complete-python-bootcamp

@asdmin

This comment has been minimized.

Copy link

asdmin commented Jan 28, 2019

To get the cookie data, use your browser's developer tools. Select the network tab and filter for "start". You can probably use other elements but this is what I used. For the "start" element look at the header info. Under request headers look at the raw cookie data. Build the cookie into netscape format. I used https://crdx.org/cookies/ but a google search should find an online utility. Create a text file and point to it with the --cookie command. My youtube-dl example is below. Hope this helps!

It's easier to use a browser extension (https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/) to get the cookies directly, and you don't need to use complicated procedures, and expose them to external services.

@carlosuema

This comment has been minimized.

Copy link

carlosuema commented Jan 28, 2019

To get the cookie data, use your browser's developer tools. Select the network tab and filter for "start". You can probably use other elements but this is what I used. For the "start" element look at the header info. Under request headers look at the raw cookie data. Build the cookie into netscape format. I used https://crdx.org/cookies/ but a google search should find an online utility. Create a text file and point to it with the --cookie command. My youtube-dl example is below. Hope this helps!

It's easier to use a browser extension (https://addons.mozilla.org/en-US/firefox/addon/cookies-txt/) to get the cookies directly, and you don't need to use complicated procedures, and expose them to external services.

Hello!

I used this method with cookies and was very happy. But it does not seem to work anymore. Could you confirm me?

@varunjha089

This comment has been minimized.

Copy link

varunjha089 commented Jan 29, 2019

Is this technique will work for downloading the course from LinkedIn learning

@charlieInDen

This comment has been minimized.

Copy link

charlieInDen commented Feb 6, 2019

Please how can we download udemy business video, tried prepending /learn/v4 but still wont accept the url format.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment