r0oth3x49 / udemy-dl

A cross-platform python based utility to download courses from udemy for personal offline use.
MIT License
4.86k stars 1.2k forks source link

DRM protected video streams are being skipped (udemy-dl not downloading videos) #627

Open nChauhan91 opened 3 years ago

nChauhan91 commented 3 years ago

When i'm trying to download any course any videos that have their URLs starting in blob:https://URL_UDEMY are being skipped.

the lectures are recognized but only assets in that chapter are downloaded. I have all requirements including ffmpeg installed & working in command line.

[i] : Downloading chapter : (2) [i] : Chapter (02 JavaScript Refresher) [i] : Found (13) lecture(s).

[i] : Downloading asset(s) [i] : Downloading (022 next-gen-js-summary.pdf) [+] : Asset : '022 next-gen-js-summary.pdf' (already downloaded)

Lectures were found but not downloaded

evon0101 commented 3 years ago

Yes, I recently downloadeda courses. and it only downloaded assests no videos. Why?

xalgord commented 3 years ago

i got the same problem, it is skipping some videos.

r0oth3x49 commented 3 years ago

@nChauhan91 i might need cookies or creds of an account to reproduce and fix the issue as i can't reproduce it with the courses i have in my account.

the otherway could be finding a course which is free and produces the same issue so that i can enroll and check against that.

for courses that i have in my account, udemy-dl is working fine for me.

xalgord commented 3 years ago

okay you can take my account: access_token = ****

xalgord commented 3 years ago

and try to use this command:

python3 udemy-dl.py https://www.udemy.com/course/web-development-masterclass-complete-certificate-course/learn/lecture/5770596?start=45#overview --skip-sub -k cookie.txt.txt
nChauhan91 commented 3 years ago

This is the course which i had issues with, in this specifically chapter 2 had videos starting URL with blob

https://www.udemy.com/course/react-the-complete-guide-incl-redux/

r0oth3x49 commented 3 years ago

okay you can take my account: access_token = ****

@xalgord thanks for sharing your cookies you could have shared it on my email though. never share such things publicly as i will not be responsible for misuse its just an advice i have edited the comment, you can re-login or update password so that the access-token gets changed as using this token anyone with udemy-dl will be able to download all courses from your account without your permission.

my email is also listed on profile: logout and login back again and share the new access_token over email nasir251292@gmail.com,

If privacy is no concern for you then it's okay i will continue testing with the access token you provided and you don't need to change anything. the token will expire soon though but i have checked for me the token even worked for days. (never checked expiry time)

xalgord commented 3 years ago

okay you can take my account: access_token = ****

@xalgord thanks for sharing your cookies you could have shared it on my email though. never share such things publicly as i will not be responsible for misuse its just an advice i have deleted the comment, you can re-login or update password so that the access-token gets changed as using this token anyone with udemy-dl will be able to download all courses from your account without your permission.

my email is also listed on profile: logout and login back again and share the new access_token over email nasir251292@gmail.com,

If privacy is no concern for you then it's okay i will continue testing with the access token you provided and you don't need to change anything. the token will expire soon though but i have checked for me the token even worked for days. (never checked expiry time)

okkay sir, i understand.

KoichaDev commented 3 years ago

Has this been fixed? I also get issue on this course: https://www.udemy.com/course/react-the-complete-guide-incl-redux/ It doesn't download anything from Section 2: JavaScript Refresher and is skipping some other videos on Section 3 as well. Can't remember exactly on top of my head.

nChauhan91 commented 3 years ago

Has this been fixed? I also get issue on this course: https://www.udemy.com/course/react-the-complete-guide-incl-redux/ It doesn't download anything from Section 2: JavaScript Refresher and is skipping some other videos on Section 3 as well. Can't remember exactly on top of my head.

This question was made exactly for this course & chapter 😁

neorus616 commented 3 years ago

I have found another course with same problem i think udemy.com/course/the-complete-guide-to-angular-2/

Dudeonyx commented 3 years ago

I noticed that the ones it skips for me are also disabled for download on the udemy site. i.e the download button is greyed out for those courses

stonekase commented 3 years ago

Please add this course to the list of courses with alot of skips https://www.udemy.com/course/unrealcourse/learn/lecture/15637754

termita81 commented 3 years ago

First, thanks for doing this tool!

Second, I am also encountering issues with https://www.udemy.com/course/the-web-developer-bootcamp - but only some sections/chapters, e.g. 29.

r0oth3x49 commented 3 years ago

i have tried to it reproduce with cookies/access_token provided but unfortunately i was not able to do that on that particular course. so i might need an account credentials to reproduce and fix the issue instead of access_token/cookies.

send account creds on: nasir251292@gmail.com (only one user having the course which is causing the issue which exact chapter number).

i 'm not able to reproduce the issue with access_token, i 'm asking for account because i need to debug it a bit deeper to check how i can make it possible to download or if it is possible or not.

zhulinpinyu commented 3 years ago

@r0oth3x49 https://github.com/r0oth3x49/udemy-dl/blob/master/udemy/extract.py#L398 m3u8 data has been encrypted please support decrypted.

Screen Shot 2021-04-19 at 16 37 41 Screen Shot 2021-04-19 at 16 37 54 Screen Shot 2021-04-19 at 16 38 09
Xd43431T commented 3 years ago

Hello, I have the same issue. Only download assets but video? Can you help me please. Below is the picture FYI. Found lectures but not download then.

image

Xd43431T commented 3 years ago

My course is https://ninjavan.udemy.com/course/case-study-powerpoint-2013-presentation-slide-by-slide/learn/lecture/5909112#overview, it happens nothing from Chapter 4 onwards.

I tried to test other courses. It happens also for all of the courses which I tested. Almost chapters are not filled in full video.

Xd43431T commented 3 years ago

Please add this course to the list of courses with alot of skips https://www.udemy.com/course/unrealcourse/learn/lecture/15637754

are you able to download at this time?

h1n054ur commented 3 years ago

same here skipping a bunch of courses and videos

ambi1997 commented 3 years ago

Same here. I think Udemy upgraded its security(encryption). It's the end(publicly) I guess. RIP 😔

Dudeonyx commented 3 years ago

https://github.com/FaisalUmair/udemy-downloader-gui/issues/570#issuecomment-823101679

r0oth3x49 commented 3 years ago

@r0oth3x49 https://github.com/r0oth3x49/udemy-dl/blob/master/udemy/extract.py#L398 m3u8 data has been encrypted please support decrypted.

Screen Shot 2021-04-19 at 16 37 41 Screen Shot 2021-04-19 at 16 37 54 Screen Shot 2021-04-19 at 16 38 09

i guess it was always encrypted. would be great if you can share your creds on my email so that i can check, If it's the issue with encryption i will implement a mechanism to download those as well.

email: nasir251292@gmail.com

r0oth3x49 commented 3 years ago

Same here. I think Udemy upgraded its security(encryption). It's the end(publicly) I guess. RIP pensive

i can give it a try to implement a mechanism for downloading, but i need a proper account with the course i can reproduce the issue and then try implementing a fix if any.

r0oth3x49 commented 3 years ago

I already have requested an account, I can't reproduce with the courses i have in my account so either provide me a free course URL that reproduces the issue or provide me an account creds on my email with the course url that is having the issue.

i have already tested it with cookies but it didn't helped, That's why i 'm asking for an account otherwise i can't do much about it if i can't reproduce the issue myself.

r0oth3x49 commented 3 years ago

okay i guess i managed to figured it out i will check try implement a fix soon. Hopefully it will work.

noorudd-in commented 3 years ago

I already have requested an account, I can't reproduce with the courses i have in my account so either provide me a free course URL that reproduces the issue or provide me an account creds on my email with the course url that is having the issue.

i have already tested it with cookies but it didn't helped, That's why i 'm asking for an account otherwise i can't do much about it if i can't reproduce the issue myself.

I have emailed you bro. I have given you my account with then course url. Also Today there is new error. When I am trying to download the course, Its saying forbitten. Why??

muddasir23 commented 3 years ago

I also face same issues with my courses, can you please fix ASAP, it would be great help. Thanks :) https://www.udemy.com/course/php-with-laravel-for-beginners-become-a-master-in-laravel/

iaman1998 commented 3 years ago

I also face same issues with my courses, can you please fix ASAP, it would be great help. Thanks :) https://www.udemy.com/course/php-with-laravel-for-beginners-become-a-master-in-laravel/

If you want it fixed ASAP mail the dev your credentials

samsung-191t commented 3 years ago

https://www.udemy.com/course/data-science-deep-learning-in-theano-tensorflow/ https://www.udemy.com/course/python-for-data-science-and-machine-learning-bootcamp/ https://www.udemy.com/course/data-science-and-machine-learning-with-python-hands-on/ https://www.udemy.com/course/cutting-edge-artificial-intelligence/ https://www.udemy.com/course/microsoft-power-bi-up-running-with-power-bi-desktop/ https://www.udemy.com/course/microsoft-excel-power-query-power-pivot-dax/ https://www.udemy.com/course/aiunitygame/ https://www.udemy.com/course/arduino-programming-for-beginners/ https://www.udemy.com/course/artificial-intelligence-augmented-reality-in-unity-xcode/ https://www.udemy.com/course/complete-machine-learning-and-data-science-zero-to-mastery/ https://www.udemy.com/course/complete-python-postgresql-database-course/ https://www.udemy.com/course/desktop-gui-python-tkinter/

example available here: https://filebin.net/dwb6bp8hubs7t90b/ERROR.PNG?t=mrs20026

First of all and, most importantly, THANK YOU Nasir Khan for your great knowledge and to have made this software. God bless you!

Now, the problems LOL .... The above links were tested and are part of some of the several hundreds of courses that we cannot download all the available videos from (not to mention a great deal of assets). I have checked many personal links. I realised the Udemy-dl software accuses the existence of folders and these very folders host many videos within, as for instance Udemy-dl says "Chapter 22. Found 10 lecture(s)", but it does not download 10 lectures. Most of time does not download them at all. Udemy-dl does not trigger alert messages saying that there is an error in the end of the whole download process. Normally Udemy-dl errors are written in either color red or light blue (i.e. "download skipped"). However, there are no errors to look for and everything seems okay. Quite by chance I read the other forum members and their statements complaining about issues. It made me revise all the material I downloaded last year. The conclusion is that I have checked older links I downloaded with Udemy-dl (version 1 and 1.1). It does not matter using version 1 or 1.1, because both versions cannot download all the available videos. Many, but many many folders that were "apparently" fine have been missing video contents. It will be difficult to evaluate the full extent of troublesome links. I estimate at least 350 courses having incomplete downloaded material. I am appalled in disbelieve now! I thought that all my courses were safely stored in my hard disk, secure, but it is not since too much information is missing. UDEMY say that once we buy a course, we have a lifetime full access, but who knows if this policy can be legally changed in a not so distant future? Who knows if UDEMY is sold and merged with a bigger group that does not endorse old policies and leave us, customers, holding the bag. UDEMY is, on the other hand, very clear when they state that "by default, it is not possible to download complete courses to the computer, for piracy reasons ". So, if we could have downloaded something with Udemy-dl, it is already a blessing. They will not encourage and will not make it easy for us to download anything. UDEMY also say that " it may be necessary for Udemy to remove a course from the platform due to political or legal reasons" ... and also "Our marketplace model means that we do not own the copyright to the content of the courses. These rights are the property of the respective instructors. Students also receive lifetime access to free courses, as long as their accounts remain active and UDEMY continues to hold the license for the course." In other words, there is a very good likelihood that every course that you have paid and you thought will be yours, can be simply discontinued or have the licency plainly revoked !!

elevul commented 3 years ago

Hi,

Facing the same issue with: https://www.udemy.com/course/az-102-azure-administrator-certification-transition/ and https://www.udemy.com/course/exam-az-microsoft-azure-exam-role1/

youtube-dl shows the following error: [debug] Invoking downloader on 'https://knowband-asset-bucket.s3.amazonaws.com/2020-01-17_10-10-39-3c727aeeeb3aac5866e13da09cf14adb/WebHD_720p.mp4' ERROR: unable to download video data: HTTP Error 403: Forbidden

udemy-dl docker container doesn't show any errors, it' just completely skips the affected videos: image

The interesting thing (additional information from youtube-dl) is that videos hosted on udemy rather than on aws are ok: image

Please let me know how I can pull logfiles from udemy-dl docker container so I can provide additional information on the errors.

z-Marcus commented 3 years ago

same here. some lectures can be downloaded, many more are simply skipped.

looking forward to your fix.

this is an awesome way to get udemy videos. Thumbsup

GerlachM commented 3 years ago

You can reproduce it/get that blob link in this free course:

https://www.udemy.com/course/big-data-on-amazon-web-services-aws-cloud-2018?couponCode=D6A07C58FBEADC011FF9

There are a few lectures with that blob link (for ex. 3. Why Use AWS for Big Data)

Also looking forward to your fix!

dss91 commented 3 years ago

hi nasir any update on fix ? or temporarily can issue get resolved by degrading version ?

kumareshr commented 3 years ago

i have tried using older version https://github.com/r0oth3x49/udemy-dl/releases/tag/v1.0 but still same issue.

yuanhang110 commented 3 years ago

same question,hope can fix it soon

Obinar commented 3 years ago

Having the same issues as everyone else. waiting patiently for this fix.

Thanks, Nasir for this amazing tool.

U rock bro!

r0oth3x49 commented 3 years ago

The problem with those videos not downloading is because udemy started providing the protected DRM streams which is currently not supported by ffmpeg, Looking for alternative ways or trying to fix it to add support for downloading DRM protected streams might take some time to implement a fix.

In the mean time other solutions/ways are also welcome.

Thanks.

naelkilani commented 3 years ago

I'm facing the same issue :(

amitjpr commented 3 years ago

facing the same issue, only assets are getting downloded .

Def3nder commented 3 years ago

does this point in the right direction ?

https://github.com/Jayapraveen/Drm-Dash-stream-downloader

iampikus commented 3 years ago

does this point in the right direction ?

https://github.com/Jayapraveen/Drm-Dash-stream-downloader

Hi! I think you're right! =) I founded "index.mpd" file in developer mode. also there is links like "https://www.udemy.com/api-2.0/media-license-server/validate-auth-token?drm_type=widevine". Widevine protection. As I know CENC (widevine L3) protection already pwned.

index.mpd contents:

`<?xml version="1.0" ?>

`
naelkilani commented 3 years ago

does this point in the right direction ? https://github.com/Jayapraveen/Drm-Dash-stream-downloader

Hi! I think you're right! =) I founded "index.mpd" file in developer mode. also there is links like "https://www.udemy.com/api-2.0/media-license-server/validate-auth-token?drm_type=widevine". Widevine protection. As I know CENC (widevine L3) protection already pwned.

index.mpd contents:

<?xml version="1.0" ?> <MPD id="201" mediaPresentationDuration="PT988.166S" minBufferTime="PT30S" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="static" xmlns="urn:mpeg:dash:schema:mpd:2011"> <Period duration="PT988.166S" id="1" start="PT0.000S"> <AdaptationSet bitstreamSwitching="true" mimeType="video/mp4" segmentAlignment="true" startWithSAP="1" subsegmentAlignment="true" subsegmentStartsWithSAP="1"> <Representation bandwidth="85844" codecs="avc1.4D401E" frameRate="30/1" height="360" id="1" width="640"> <ContentProtection schemeIdUri="urn:mpeg:dash:mp4protection:2011" value="cenc"/> <ContentProtection schemeIdUri="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"/> <ContentProtection schemeIdUri="urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95" value="MSPR 2.0"/> <SegmentTemplate initialization="https://dash-enc-b.udemycdn.com/_bC2LYMmdE6vOekGXQqaFw==,1619864615/out/v1/987980e53c5a44e9a67f6d945602b5e0/06c8dc12da2745f1b0b4e7c2c032dfef/bf52921c30474743904510635f8eb9e8/0b5a4ce589de4bda9d3a4860e543ad6e/index_video_1_0_init.mp4" media="https://dash-enc-b.udemycdn.com/_bC2LYMmdE6vOekGXQqaFw==,1619864615/out/v1/987980e53c5a44e9a67f6d945602b5e0/06c8dc12da2745f1b0b4e7c2c032dfef/bf52921c30474743904510635f8eb9e8/0b5a4ce589de4bda9d3a4860e543ad6e/index_video_1_0_$Number$.mp4" presentationTimeOffset="0" startNumber="1" timescale="30000"> <SegmentTimeline> <S d="180000" r="163" t="3440"/> <S d="125000" t="29523440"/> </SegmentTimeline> </SegmentTemplate> </Representation>

@iampikus you mean you was able to fix the issue by following https://github.com/Jayapraveen/Drm-Dash-stream-downloader ??

iampikus commented 3 years ago

@naelkilani hello, no. I have no good programming skills. but based on the available information it is possible to do this. Widevine L3 is already cracked.

https://www.haktechs.com/hacking-pentesting-tools/widevine-l3-decryptor-a-chrome-extension-that-demonstrates-bypassing-widevine-l3-drm/#

So technically it is possible :)

but illegal...

iampikus commented 3 years ago

just tested "widivine decryptor" extension + old google chrome version (81.0.4044.122). in recent versions this does not work. udemy_widivine

So downloading encrypted video from udemy is possible for sure (Widivine decryptor + Drm-Dash-stream-downloader )

naelkilani commented 3 years ago

Thank you @iampikus waiting @r0oth3x49 to hack it ^^

iampikus commented 3 years ago

I am sure that @r0oth3x49 will not have any problems with the implementation of such a function, but he will not be able to include Widevine L3 DRM bypass code for legal reasons. I think he will be able to include a piece of code that does not violate the law. The missing part of the code will be added by end users on their own responsibility :-)

ironically, a forbidden code can be googled in a few seconds. fourth search result for "tomer8007/widevine-l3-decryptor" (archive.org) ^_^

mahdisky commented 3 years ago

can you found solution for this problem? we all wating

CHITTIMOTU commented 3 years ago

just tested "widivine decryptor" extension + old google chrome version (81.0.4044.122). in recent versions this does not work. udemy_widivine

So downloading encrypted video from udemy is possible for sure (Widivine decryptor + Drm-Dash-stream-downloader )

I am sure that @r0oth3x49 will not have any problems with the implementation of such a function, but he will not be able to include Widevine L3 DRM bypass code for legal reasons. I think he will be able to include a piece of code that does not violate the law. The missing part of the code will be added by end users on their own responsibility :-)

ironically, a forbidden code can be googled in a few seconds. fourth search result for "tomer8007/widevine-l3-decryptor" (archive.org) ^_^

are you referring this repo https://github.com/Jayapraveen/Drm-Dash-stream-downloader AS "Drm-Dash-stream-downloader"? Can you please help the steps here , how to do so

iampikus commented 3 years ago

Hello! @CHITTIMOTU I couldn’t adapt this script to the udemi mpd file. I don't have enough python knowledge. I have manually downloaded several files (index_video_19_0_init.mp4 + index_video_19_0_1.mp4), concatenated them and successfully decrypted with mp4decrypt. It would be nice if r0oth3x49 could implement an MPD parser to download all segments and combine them into one encrypted file. We will decrypt the resulting files ourselves using mp4decrypt