Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.
This repository was 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

Description

@1447262390

简单描述
下载单个视频出错,换批量下载只下载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)


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions