Puyodead1 / udemy-downloader

A Udemy downloader that can download courses, with DRM support.
MIT License
1.33k stars 311 forks source link

[Bug]: it won't descrypt a video -- key(s) not found #161

Closed naddika closed 1 year ago

naddika commented 1 year ago

What happened?

I'm on Linux.

Generall everything has worked well. I don't know if my previous download were initially under encryption on Udemy, but they got downloaded and can be played.

This time it won't decrypt the videos.

$ shaka-packager -version
shaka-packager version v2.6.1-634af65-release

Details

[02:50:57] [udemy-downloader] [handle_segments:1272] ERROR: Error: 
Traceback (most recent call last):
  File "/home/me/projects/var/udemy-downloader/main.py", line 1094, in decrypt
    key = keys[kid.lower()]
          ~~~~^^^^^^^^^^^^^
KeyError: '53e0<..........>c418d'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/me/projects/var/udemy-downloader/main.py", line 1250, in handle_segments
    ret_code = decrypt(video_kid, video_filepath_enc, video_filepath_dec)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/me/projects/var/udemy-downloader/main.py", line 1097, in decrypt
    raise KeyError("Key not found")

And the variable keys is {} --> I printed it out.

What's the matter?

Expected Result

decrypted video

Branch

master/main

What operating systems are you seeing the problem on?

No response

Relevant log output

[download] 100% of    3.24MiB
[02:50:57] [udemy-downloader] [handle_segments:1228] INFO: > Lecture Tracks Downloaded
[02:50:57] [udemy-downloader] [handle_segments:1236] INFO: KID for video file is: 53E0E0<.....>418D
[02:50:57] [udemy-downloader] [handle_segments:1243] INFO: KID for audio file is: 53E0E0<.....>418D
[02:50:57] [udemy-downloader] [handle_segments:1249] INFO: > Decrypting video, this might take a minute...

# added this
***keys: {}
[02:50:57] [udemy-downloader] [handle_segments:1272] ERROR: Error: 

Other information

No response

naddika commented 1 year ago

I don't have a keyfile.json. Do I have to? if so, why are some keys get found nonetheless by the tool?

KID for video file is: <....>
naddika commented 1 year ago

Some videos of the same Udemy course have been downloaded properly, meaning, they were either non-encrypted or have been descrypted, and are playable.

Puyodead1 commented 1 year ago

I don't have a keyfile.json. Do I have to? if so, why are some keys get found nonetheless by the tool?


KID for video file is: <....>

It's not finding keys, it's just telling you the kid required for it. Not all videos are encrypted

I don't have a keyfile.json. Do I have to?

no, its totally 100% cosmetic, and serves absolutely no purpose what so ever, the program also totally does not warn you that you cant decrypt encrypted lectures. (this is obviously sarcasm)