udemy-dl icon indicating copy to clipboard operation
udemy-dl copied to clipboard

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

Open nChauhan91 opened this issue 3 years ago • 145 comments

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

  • OS Platform: macOS Big Sur & Windows 10
  • Python Version - Python 3

nChauhan91 avatar Apr 13 '21 11:04 nChauhan91

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

evon0101 avatar Apr 13 '21 12:04 evon0101

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

xalgord avatar Apr 13 '21 14:04 xalgord

@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.

r0oth3x49 avatar Apr 15 '21 02:04 r0oth3x49

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

xalgord avatar Apr 15 '21 05:04 xalgord

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

xalgord avatar Apr 15 '21 05:04 xalgord

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/

nChauhan91 avatar Apr 15 '21 05:04 nChauhan91

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 [email protected],

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)

r0oth3x49 avatar Apr 15 '21 05:04 r0oth3x49

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 [email protected],

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.

xalgord avatar Apr 15 '21 09:04 xalgord

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.

KoichaDev avatar Apr 16 '21 21:04 KoichaDev

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 😁

nChauhan91 avatar Apr 17 '21 07:04 nChauhan91

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

neorus616 avatar Apr 17 '21 09:04 neorus616

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

Dudeonyx avatar Apr 17 '21 21:04 Dudeonyx

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

stonekase avatar Apr 18 '21 01:04 stonekase

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.

termita81 avatar Apr 18 '21 09:04 termita81

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: [email protected] (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.

r0oth3x49 avatar Apr 19 '21 07:04 r0oth3x49

@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

zhulinpinyu avatar Apr 19 '21 08:04 zhulinpinyu

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 avatar Apr 20 '21 07:04 Xd43431T

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 avatar Apr 20 '21 08:04 Xd43431T

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?

Xd43431T avatar Apr 20 '21 10:04 Xd43431T

same here skipping a bunch of courses and videos

h1n054ur avatar Apr 20 '21 12:04 h1n054ur

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

ambi1997 avatar Apr 20 '21 13:04 ambi1997

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

Dudeonyx avatar Apr 20 '21 20:04 Dudeonyx

@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: [email protected]

r0oth3x49 avatar Apr 20 '21 23:04 r0oth3x49

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 avatar Apr 20 '21 23:04 r0oth3x49

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 avatar Apr 20 '21 23:04 r0oth3x49

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

r0oth3x49 avatar Apr 21 '21 00:04 r0oth3x49

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??

noorudd-in avatar Apr 21 '21 17:04 noorudd-in

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/

muddasir23 avatar Apr 22 '21 06:04 muddasir23

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

iaman1998 avatar Apr 22 '21 07:04 iaman1998

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 !!

samsung-191t avatar Apr 22 '21 18:04 samsung-191t

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.

elevul avatar Apr 22 '21 22:04 elevul

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

z-Marcus avatar Apr 23 '21 13:04 z-Marcus

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!

GerlachM avatar Apr 23 '21 17:04 GerlachM

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

dss91 avatar Apr 24 '21 01:04 dss91

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

kumareshr avatar Apr 24 '21 02:04 kumareshr

same question,hope can fix it soon

yuanhang110 avatar Apr 24 '21 09:04 yuanhang110

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

Thanks, Nasir for this amazing tool.

U rock bro!

Obinar avatar Apr 24 '21 10:04 Obinar

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.

r0oth3x49 avatar Apr 24 '21 12:04 r0oth3x49

I'm facing the same issue :(

naelkilani avatar Apr 25 '21 17:04 naelkilani

facing the same issue, only assets are getting downloded .

amitjpr avatar Apr 30 '21 05:04 amitjpr

does this point in the right direction ?

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

Def3nder avatar Apr 30 '21 10:04 Def3nder

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 avatar May 01 '21 06:05 iampikus

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 ??

naelkilani avatar May 02 '21 00:05 naelkilani

@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 avatar May 02 '21 06:05 iampikus

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 )

iampikus avatar May 02 '21 08:05 iampikus

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

naelkilani avatar May 02 '21 12:05 naelkilani

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) ^_^

iampikus avatar May 02 '21 16:05 iampikus

can you found solution for this problem? we all wating

mahdisky avatar May 07 '21 11:05 mahdisky

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

CHITTIMOTU avatar May 10 '21 09:05 CHITTIMOTU

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

iampikus avatar May 11 '21 13:05 iampikus

Hey Christopher sierra,

How about Udemy business? already used business account and udemy-dl to download courses

Vào Th 4, 12 thg 5, 2021 vào lúc 00:32 christopher sierra < @.***> đã viết:

When someone uses the udemy-dl script and tries to see if the refund is available the following message appears:

Based on your download history, this course is not eligible for a refund. In accordance with our refund policy, we are unable to grant you a refund request for the course because you downloaded it in a way that violates our terms of use. If breaches occur in the future, we may take action on your account.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-838877411, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATYHO7SUXTJ4QXUQ3QJJNWTTNFS2NANCNFSM423F5HFQ .

Xd43431T avatar May 13 '21 04:05 Xd43431T

image

Hey Christopher sierra,

How about Udemy business? already used business account and udemy-dl to download courses

Xd43431T avatar May 13 '21 04:05 Xd43431T

@r0oth3x49 check this repo's hope this will help

https://github.com/parnexcodes/widevine-L3-WEB-DL-Script https://github.com/WHTJEON/narrowvine

Ex-Communicad0 avatar May 13 '21 13:05 Ex-Communicad0

@r0oth3x49 check this repo's hope this will help

https://github.com/parnexcodes/widevine-L3-WEB-DL-Script https://github.com/WHTJEON/narrowvine

Thank you for sharing! I'll try use that. =)

UPDATE Just tested narrowvine script and it is not working. yt-dlp is not optimized for udemy. I get error:

[udemy:course] assets: Downloading webpage ERROR: Unable to extract course id; please report this issue on https://github.com/yt-dlp/yt-dlp . Make sure you are using the latest version; see https://github.com/yt-dlp/yt-dlp on how to update. Be sure to call yt-dlp with the --verbose flag and include its complete output.

I think widevine-L3-WEB-DL-Script won't work either, cause it uses yt-dlp

iampikus avatar May 13 '21 15:05 iampikus

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

Thanks @iampikus the solution seems implementable to me, i will test it locally, it will be great help if you can email me a proper steps/solution, i was thinking about using the Bento4 tools, but don't have enough time to research on how i could automate the process that's why asking you send me full solution how you manage to use it manually so that i can try implement it in udemy-dl.

Once again thank you for your great help and research.

email: [email protected]

r0oth3x49 avatar May 14 '21 17:05 r0oth3x49

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

Thanks @iampikus the solution seems implementable to me, i will test it locally, it will be great help if you can email me a proper steps/solution, i was thinking about using the Bento4 tools, but don't have enough time to research on how i could automate the process that's why asking you send me full solution how you manage to use it manually so that i can try implement it in udemy-dl.

Once again thank you for your great help and research.

email: [email protected]

take a look at this, would this work?
https://github.com/Jayapraveen/Drm-Dash-stream-downloader/blob/master/dashdownloader_multisegment.py#L125

Puyodead1 avatar May 14 '21 18:05 Puyodead1

Great work guys! Look forward to a solution.

joaobrasil65 avatar May 15 '21 19:05 joaobrasil65

@r0oth3x49 bro you got the account? I've one business account and I'm ready to share. Let me know if you need. And btw I'm too getting error. It automatically skips lectures.

Kaatne-Wala-Kutta avatar May 16 '21 10:05 Kaatne-Wala-Kutta

I've paid for well over 20 course on udemy, but with this current policy of preventing downloads which affects genuine customers far more than it affects pirates I'm honestly disappointed.

For now I've given up on the download ever working in a convenient manner so I'll just search for torrents of courses I've bought and download those.

I'll look for a more convenient site to give my money to in the future or failing that, stick with free courses but no piracy.

Dudeonyx avatar May 16 '21 12:05 Dudeonyx

This probably won't ever get fixed, it's possible to download DRM encrypted media and decrypt it but it would get a DMCA takedown pretty quickly. Even then, there's still some problems I've noticed since it doesn't look like udemy puts the decryption key IDs in the dash manifests so automation would be slightly more difficult.

Puyodead1 avatar May 17 '21 23:05 Puyodead1

So we can't download videos anymore?

On Mon, May 17, 2021 at 7:04 PM Puyodead1 @.***> wrote:

This probably won't ever get fixed, it's possible to download DRM encrypted media and decrypt it but it would get a DMCA takedown pretty quickly. Even then, there's still some problems I've noticed since it doesn't look like udemy puts the decryption key IDs in the dash manifests so automation would be more difficult.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-842697723, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKPIJLP45T2GEXQH673TOGOH7ANCNFSM423F5HFQ .

joaobrasil65 avatar May 17 '21 23:05 joaobrasil65

Just a quick little bit of information i seem to have found, all the lectures in a course use the same decryption key (per user ofc). So if you get the key from something like a browser extension, you could download all the DRM lectures and decrypt them pretty easy compared to having to get different keys for each video. Probably not all the helpful to most people but felt like its worth sharing.

One possible way to get around legal issues, would be to not provide something that can get the keys, if the program asked the user to get the key themself and provide it to the program, then it should be fine i think, idk.

Puyodead1 avatar May 18 '21 18:05 Puyodead1

how would i do that exactly? get the key? Could we automate that process if they can figure out how to get the video pieces and put them together?

On Tue, May 18, 2021 at 2:45 PM Puyodead1 @.***> wrote:

Just a quick little bit of information i seem to have found, all the lectures in a course use the same decryption key (per user ofc). So if you get the key from something like a browser extension, you could download all the DRM lectures and decrypt them pretty easy compared to having to get different keys for each video. Probably not all the helpful to most people but felt like its worth sharing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-843442632, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKOTSR7DOWVZZWUYQJ3TOKYUBANCNFSM423F5HFQ .

joaobrasil65 avatar May 18 '21 19:05 joaobrasil65

how would i do that exactly? get the key? Could we automate that process if they can figure out how to get the video pieces and put them together? On Tue, May 18, 2021 at 2:45 PM Puyodead1 @.***> wrote: Just a quick little bit of information i seem to have found, all the lectures in a course use the same decryption key (per user ofc). So if you get the key from something like a browser extension, you could download all the DRM lectures and decrypt them pretty easy compared to having to get different keys for each video. Probably not all the helpful to most people but felt like its worth sharing. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKOTSR7DOWVZZWUYQJ3TOKYUBANCNFSM423F5HFQ .

you would need to use something like a chrome extension that can decrypt the license request (such things have been mentioned in this issues comments). everything could be automated other than getting the keys due to legal issues.

Currently I'm using a modified version of https://github.com/Jayapraveen/Drm-Dash-stream-downloader, with modified code from https://github.com/alastairmccormack/pywvpssh and https://github.com/alastairmccormack/pymp4parse/ for semi-automated downloading of videos.

Puyodead1 avatar May 18 '21 19:05 Puyodead1

@Puyodead1 can you make a video for do solution step to step ? then upload it in youtube or private.

@r0oth3x49 can you help us ?

mahdisky avatar May 18 '21 19:05 mahdisky

@Puyodead1 can you make a video for do solution step to step ? then upload it in youtube or private.

@r0oth3x49 can you help us ?

I don't think i can/should since it involves bypassing DRM.

Puyodead1 avatar May 18 '21 19:05 Puyodead1

@Puyodead1 will you be able to share your current setup on using the https://github.com/Jayapraveen/Drm-Dash-stream-downloader and https://github.com/alastairmccormack/pywvpssh / https://github.com/alastairmccormack/pymp4parse/ ? No need for getting the keys. By the way if you guys still are trying to bypass the DRM using the keys I regret to inform you that by the end of the month it's already going to be updated and won't support the current work around.

atakurt034 avatar May 18 '21 21:05 atakurt034

@Puyodead1 will you be able to share your current setup on using the https://github.com/Jayapraveen/Drm-Dash-stream-downloader and https://github.com/alastairmccormack/pywvpssh / https://github.com/alastairmccormack/pymp4parse/ ? No need for getting the keys. By the way if you guys still are trying to bypass the DRM using the keys I regret to inform you that by the end of the month it's already going to be updated and won't support the current work around.

Yeah, the repository is on my GitHub. currently it only supports downloading a single course by the mpd url but im going to add downloading an entire course (drm and non-drm videos).

Puyodead1 avatar May 18 '21 21:05 Puyodead1

@Puyodead1 will you be able to share your current setup on using the https://github.com/Jayapraveen/Drm-Dash-stream-downloader and https://github.com/alastairmccormack/pywvpssh / https://github.com/alastairmccormack/pymp4parse/ ? No need for getting the keys. By the way if you guys still are trying to bypass the DRM using the keys I regret to inform you that by the end of the month it's already going to be updated and won't support the current work around.

Yeah, the repository is on my GitHub. currently it only supports downloading a single course by the mpd url but im going to add downloading an entire course (drm and non-drm videos).

Nice. Thanks a lot.

atakurt034 avatar May 18 '21 22:05 atakurt034

@Puyodead1 will you be able to share your current setup on using the https://github.com/Jayapraveen/Drm-Dash-stream-downloader and https://github.com/alastairmccormack/pywvpssh / https://github.com/alastairmccormack/pymp4parse/ ? No need for getting the keys. By the way if you guys still are trying to bypass the DRM using the keys I regret to inform you that by the end of the month it's already going to be updated and won't support the current work around.

Yeah, the repository is on my GitHub. currently it only supports downloading a single course by the mpd url but im going to add downloading an entire course (drm and non-drm videos).

Nice. Thanks a lot.

I can get the key, but don't know the steps to download, Can you please help us with instructions , how to use your repo https://github.com/Puyodead1/udemy-downloader image

CHITTIMOTU avatar May 18 '21 23:05 CHITTIMOTU

@Puyodead1 will you be able to share your current setup on using the https://github.com/Jayapraveen/Drm-Dash-stream-downloader and https://github.com/alastairmccormack/pywvpssh / https://github.com/alastairmccormack/pymp4parse/ ? No need for getting the keys. By the way if you guys still are trying to bypass the DRM using the keys I regret to inform you that by the end of the month it's already going to be updated and won't support the current work around.

Yeah, the repository is on my GitHub. currently it only supports downloading a single course by the mpd url but im going to add downloading an entire course (drm and non-drm videos).

Nice. Thanks a lot.

I can get the key, but don't know the steps to download, Can you please help us with instructions , how to use your repo https://github.com/Puyodead1/udemy-downloader image

Make an issue on the repo and i can help you there, i dont want to get too offtopic here.

Puyodead1 avatar May 18 '21 23:05 Puyodead1

Hello guys Just wondering whether we are going to get a workaround to this issue or not? I am also facing the same issue. Videos being skipped while downloading. In few situations, entire course is getting skipped. Ex: https://wipro.udemy.com/course/progressive-web-app-pwa-the-complete-guide/ Plz lets find a fix to this issue at the earliest, or at least a workaround

Thankyou

saurabh9813 avatar May 19 '21 07:05 saurabh9813

@r0oth3x49 I think maybe you have to add "access_token" and "dj_session_id" both to solve the problem. have a try.

that wont magically download and decrypt encrypted videos. Udemy added Widevine DRM to newer videos.

Puyodead1 avatar May 19 '21 17:05 Puyodead1

@r0oth3x49 do you know what is "skd://32 character hex text" is it the AES key? maybe we need to convert it to decimal or binary bit if I convert the 32char hex I'm getting a 128 character binary.

MdTalhaZubayer avatar May 20 '21 09:05 MdTalhaZubayer

@r0oth3x49 do you know what is "skd://32 character hex text" is it the AES key? maybe we need to convert it to decimal or binary bit if I convert the 32char hex I'm getting a 128 character binary.

That's related to Apple FairPlay DRM, the skd:// is probably the asset_id but afaik there no way to get keys for fairplay content.

Puyodead1 avatar May 20 '21 12:05 Puyodead1

I think Udemy has for sure seen this code and decided to implement the DRM so that no one should possibly be able to download anything from their site. But still not losing hope ! I have my subscription till September.

a8uh35h4m avatar May 21 '21 03:05 a8uh35h4m

Probably. They make it so hard to use offline. Their mobile apps are horrible

On Thu, May 20, 2021, 11:01 PM a8uh35h4m @.***> wrote:

I think Udemy has for sure seen this code and decided to implement the DRM so that no one should possibly be able to download anything from their site. But still not losing hope ! I have my subscription till September.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-845616733, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKKNYJYNR3GYZC5NSR3TOXEGRANCNFSM423F5HFQ .

joaobrasil65 avatar May 21 '21 03:05 joaobrasil65

image Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file.

So this blob file contains lists which video player plays probably.

Farrukh2019 avatar May 22 '21 14:05 Farrukh2019

Yes, It's adaptive streaming, the files are split into segments. There's 2 types: HLS and MPEG-DASH. It's still encrypted with DRM. I already made a program that can download the segments, join them and decrypt them but you need to know the key still.

On Sat, May 22, 2021 at 10:29 AM Farrukh2019 @.***> wrote:

[image: image] https://user-images.githubusercontent.com/55839110/119229984-b89daf00-bb33-11eb-8d47-f54dc15310ce.png Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-846416029, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADREJXX5BSPRPHPVYSQG2QLTO65UFANCNFSM423F5HFQ .

Puyodead1 avatar May 22 '21 14:05 Puyodead1

Yes, It's adaptive streaming, the files are split into segments. There's 2 types: HLS and MPEG-DASH. It's still encrypted with DRM. I already made a program that can download the segments, join them and decrypt them but you need to know the key still. On Sat, May 22, 2021 at 10:29 AM Farrukh2019 @.***> wrote: [image: image] https://user-images.githubusercontent.com/55839110/119229984-b89daf00-bb33-11eb-8d47-f54dc15310ce.png Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADREJXX5BSPRPHPVYSQG2QLTO65UFANCNFSM423F5HFQ .

Key must be some where on the page javascript is open system , since browser is playing it it must be identifyable.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

Yes, It's adaptive streaming, the files are split into segments. There's 2 types: HLS and MPEG-DASH. It's still encrypted with DRM. I already made a program that can download the segments, join them and decrypt them but you need to know the key still. On Sat, May 22, 2021 at 10:29 AM Farrukh2019 @.***> wrote: [image: image] https://user-images.githubusercontent.com/55839110/119229984-b89daf00-bb33-11eb-8d47-f54dc15310ce.png Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADREJXX5BSPRPHPVYSQG2QLTO65UFANCNFSM423F5HFQ .

Key must be some where on the page javascript is open system , since browser is playing it it must be identifyable.

lol no, thats not how it works. its Widevine DRM, they dont just leave a key laying around. the point of DRM is to prevent people from downloading the videos offline. If you're interested on learning how it works, read into Encrypted Media Extensions.

widevine

Puyodead1 avatar May 22 '21 15:05 Puyodead1

Yes, It's adaptive streaming, the files are split into segments. There's 2 types: HLS and MPEG-DASH. It's still encrypted with DRM. I already made a program that can download the segments, join them and decrypt them but you need to know the key still. On Sat, May 22, 2021 at 10:29 AM Farrukh2019 @.***> wrote: [image: image] https://user-images.githubusercontent.com/55839110/119229984-b89daf00-bb33-11eb-8d47-f54dc15310ce.png Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADREJXX5BSPRPHPVYSQG2QLTO65UFANCNFSM423F5HFQ .

Key must be some where on the page javascript is open system , since browser is playing it it must be identifyable.

lol no, thats not how it works. its Widevine DRM, they dont just leave a key laying around. the point of DRM is to prevent people from downloading the videos offline. If you're interested on learning how it works, read into Encrypted Media Extensions

Lol i was just trying to download a course i made a tampermonkey extension which was doing the job but some video were not coming so i decided to try udemy-dl it has same issue.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

Yes, It's adaptive streaming, the files are split into segments. There's 2 types: HLS and MPEG-DASH. It's still encrypted with DRM. I already made a program that can download the segments, join them and decrypt them but you need to know the key still. On Sat, May 22, 2021 at 10:29 AM Farrukh2019 @.***> wrote: [image: image] https://user-images.githubusercontent.com/55839110/119229984-b89daf00-bb33-11eb-8d47-f54dc15310ce.png Seemingly its not single file , there is a list of files which video player plays. Audio and video are in separated files so i think 2 lists are working here one is list of videos other is list of audio. You have to come up with method to download all videos and audios in list then merge them in single file. — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADREJXX5BSPRPHPVYSQG2QLTO65UFANCNFSM423F5HFQ .

Key must be some where on the page javascript is open system , since browser is playing it it must be identifyable.

lol no, thats not how it works. its Widevine DRM, they dont just leave a key laying around. the point of DRM is to prevent people from downloading the videos offline. If you're interested on learning how it works, read into Encrypted Media Extensions

Lol i was just trying to download a course i made a tampermonkey extension which was doing the job but some video were not coming so i decided to try udemy-dl it has same issue.

Yeah? whats your point exactly? Udemy-DL is broken....

Puyodead1 avatar May 22 '21 15:05 Puyodead1

My point is that there must be some way to download them and see them with ease , that's what i am finding.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

My point is that there must be some way to download them and see them with ease , that's what i am finding.

the reason some videos work and other dont is that newer videos have DRM, older ones dont. good luck cracking the widevine CDM pal. if it was so easy, everyone would be ripping content from netflix, spotify, hulu, hbo max, Disney+, apple tv and tons of other streaming sites that use Widevine DRM

Puyodead1 avatar May 22 '21 15:05 Puyodead1

You can download the videos but you cant view them because they're encrypted.

Puyodead1 avatar May 22 '21 15:05 Puyodead1

so how user finds key ?

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

Considering that Widevine L3 decryptors were DMCAd from GitHub by Google, IMHO this issue can be marked as unresolvable.

rijenkii avatar May 22 '21 15:05 rijenkii

so how user finds key ?

by knowing about the extension that intercepts the license requests :) im not giving instructions on it because its considered piracy, do a little research and you might find it

Puyodead1 avatar May 22 '21 15:05 Puyodead1

Considering that Widevine L3 decryptors were DMCAd from GitHub by Google and L2 and L1 decryptors do not exist, IMHO this issue can be marked as unresolvable.

Yeah, i dont see this ever getting a "fix" or a "workaround".

Puyodead1 avatar May 22 '21 15:05 Puyodead1

i better use screen recording system to save time .... i will check later if issue is solved or not.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

i better use screen recording system to save time .... i will check later if issue is solved or not.

that might work, but iirc the screen blacks out to prevent screen recording

Puyodead1 avatar May 22 '21 15:05 Puyodead1

i have checked it does not black out.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

record in HD see many times save bandwidth load.

Farrukh2019 avatar May 22 '21 15:05 Farrukh2019

Is it true that per account you get a specific set of keys or they would vary from each course?

atakurt034 avatar May 22 '21 15:05 atakurt034

Is it true that per account you get a specific set of keys or they would vary from each course?

well usually each video should have its own unique key that isnt shared, but udemy seems to share the same key throughout an entire course

Puyodead1 avatar May 22 '21 15:05 Puyodead1

@r0oth3x49 there is master m3u8 that is not encrypted but I contain the encrypted m3u8 files but I don't have any knowledge about the MPD file is it also encrypted?

MdTalhaZubayer avatar May 22 '21 17:05 MdTalhaZubayer

@r0oth3x49 there is master m3u8 that is not encrypted but I contain the encrypted m3u8 files but I don't have any knowledge about the MPD file is it also encrypted?

the master m3u8 is just links to other m3u8 playlists of different qualities, which all have encryption as well as the dash mpd files.

Puyodead1 avatar May 22 '21 19:05 Puyodead1

How do they do it in the Android app? You can download to your device. It sucks but is there something different there?

On Sat, May 22, 2021 at 3:44 PM Puyodead1 @.***> wrote:

@r0oth3x49 https://github.com/r0oth3x49 there is master m3u8 that is not encrypted but I contain the encrypted m3u8 files but I don't have any knowledge about the MPD file is it also encrypted?

The m3u8 playlist files are also encrypted, you most likely downloaded the m3u8 playlist from a video without DRM

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r0oth3x49/udemy-dl/issues/627#issuecomment-846454979, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKIWMPNU7QATEOCO7FDTPACSNANCNFSM423F5HFQ .

joaobrasil65 avatar May 22 '21 23:05 joaobrasil65

How do they do it in the Android app? You can download to your device. It sucks but is there something different there? On Sat, May 22, 2021 at 3:44 PM Puyodead1 @.***> wrote: @r0oth3x49 https://github.com/r0oth3x49 there is master m3u8 that is not encrypted but I contain the encrypted m3u8 files but I don't have any knowledge about the MPD file is it also encrypted? The m3u8 playlist files are also encrypted, you most likely downloaded the m3u8 playlist from a video without DRM — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#627 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ3XKIWMPNU7QATEOCO7FDTPACSNANCNFSM423F5HFQ .

It downloads the encrypted video and requests a license key when you want to watch it, its the same thing as how the netflix app allows you to download videos for offline viewing

Puyodead1 avatar May 22 '21 23:05 Puyodead1