Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Incorrect AES key length (39 bytes) #49

Open
codercplus opened this issue Oct 13, 2022 · 3 comments
Open

Incorrect AES key length (39 bytes) #49

codercplus opened this issue Oct 13, 2022 · 3 comments

Comments

@codercplus
Copy link

[■■■■■■■■■■■■■■■■■■■■■■■■■■■ ] 91%Traceback (most recent call last): File "qcourse.py", line 154, in <module> main() File "qcourse.py", line 106, in main asyncio.run(parse_course_url_and_download(course_url)) File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "qcourse.py", line 68, in parse_course_url_and_download await download_single(urls[0], urls[1], filename, path) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 150, in download_single decrypt_file(str(file) + '.ts', key) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 28, in decrypt_file dec = decrypt(ciphertext, key) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\downloader.py", line 20, in decrypt cipher = AES.new(key, AES.MODE_CBC, iv) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\AES.py", line 232, in new return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher return modes[mode](factory, **kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\_mode_cbc.py", line 274, in _create_cbc_cipher cipher_state = factory._create_base_cipher(kwargs) File "C:\Users\admin\Documents\qcourse_scripts-main\qcourse_scripts-main\qcourse-venv\lib\site-packages\Crypto\Cipher\AES.py", line 93, in _create_base_cipher raise ValueError("Incorrect AES key length (%d bytes)" % len(key)) ValueError: Incorrect AES key length (39 bytes)

@codercplus
Copy link
Author

失败的时候,courses目录下留下了一个ts文件,和一个无拓展名的文件。无拓展名的文件打开后内容为:“{"msg":"用户未登录","retcode":200}”。

@Scal-VictorLi
Copy link

遇到同样的情况

@aiguoli
Copy link
Owner

aiguoli commented Feb 1, 2023

更新到最新版本,然后把cookies.json删掉,重新运行试试

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants