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

下载报错ValueError: Data must be padded to 16 byte boundary in CBC mode #67

Open
1447262390 opened this issue Apr 16, 2023 · 0 comments

Comments

@1447262390
Copy link

简单描述
下载单个视频出错,换批量下载只下载1个1k的文件

环境
Python: 3.9
浏览器: edge
操作系统: Windows 10

单个下载报错日志
Traceback (most recent call last):
File "D:\PythonProject\githubProject\qcourse_scripts\qcourse.py", line 171, in
main()
File "D:\PythonProject\githubProject\qcourse_scripts\qcourse.py", line 123, in main
asyncio.run(parse_course_url_and_download(course_url))
File "C:\My_Install\Anaconda3\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\My_Install\Anaconda3\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "D:\PythonProject\githubProject\qcourse_scripts\qcourse.py", line 88, in parse_course_url_and_download
await download_single(urls[0], urls[1], filename, path)
File "D:\PythonProject\githubProject\qcourse_scripts\downloader.py", line 150, in download_single
decrypt_file(str(file) + '.ts', key)
File "D:\PythonProject\githubProject\qcourse_scripts\downloader.py", line 28, in decrypt_file
dec = decrypt(ciphertext, key)
File "D:\PythonProject\githubProject\qcourse_scripts\downloader.py", line 21, in decrypt
plaintext = cipher.decrypt(ciphertext[AES.block_size:])
File "D:\PythonProject\githubProject\venv\lib\site-packages\Crypto\Cipher_mode_cbc.py", line 246, in decrypt
raise ValueError("Data must be padded to %d byte boundary in CBC mode" % self.block_size)
ValueError: Data must be padded to 16 byte boundary in CBC mode


![image](https://user-images.githubusercontent.com/51668733/232269715-62664eb7-3155-4070-9997-79ed81c385eb.png)


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

1 participant