Puyodead1 / udemy-downloader

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

[Bug]: RuntimeError: Failed to decrypt the cipher text with DPAPI #250

Open parvinders347 opened 4 weeks ago

parvinders347 commented 4 weeks ago

What happened?

its showing this error: `[08:29:49] [udemy-downloader] [pre_run:331] INFO: Output directory set to E:\TelegramCourseRequest [08:29:49] [udemy-downloader] [init:359] WARNING: No bearer token was provided, attempting to use browser cookies. Traceback (most recent call last): File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3__init.py", line 539, in _decrypt return self._decrypt_windows_chromium(value, encrypted_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3__init__.py", line 530, in _decrypt_windowschromium , data = _crypt_unprotect_data(encrypted_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3\init__.py", line 89, in _crypt_unprotect_data raise RuntimeError('Failed to decrypt the cipher text with DPAPI') RuntimeError: Failed to decrypt the cipher text with DPAPI

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Udemy-DL\main.py", line 2066, in main() File "C:\Users\Udemy-DL\main.py", line 1932, in main udemy = Udemy(bearer_token) ^^^^^^^^^^^^^^^^^^^ File "C:\Users\Udemy-DL\main.py", line 372, in init cj = browser_cookie3.brave() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3__init.py", line 1188, in brave return Brave(cookie_file, domain_name, key_file).load() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3__init__.py", line 515, in load value = self._decrypt(value, enc_value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\singh\AppData\Local\Programs\Python\Python311\Lib\site-packages\browser_cookie3\init__.py", line 559, in _decrypt return data.decode() ^^^^^^^^^^^^^ UnicodeDecodeError: 'utf-8' codec can't decode byte 0x97 in position 2: invalid start byte`

My command: py main.py -c https://www.udemy.com/course/tableau-accelerate-your-career-and-get-certified/learn --download-assets --out E:\yobro --id-as-course-name --browser brave

Expected Result

Download the course without any error

Branch

master/main

What operating systems are you seeing the problem on?

Windows

Relevant log output

No response

Other information

No response

Onyz107 commented 4 weeks ago

I think this is related to issue #251