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

ValueError: Incorrect AES key length (39 bytes) #64

Open
Mitcheltong opened this issue Feb 6, 2023 · 1 comment
Open

ValueError: Incorrect AES key length (39 bytes) #64

Mitcheltong opened this issue Feb 6, 2023 · 1 comment

Comments

@Mitcheltong
Copy link

简单描述
下载单个视频出错

环境
Python: 3.11.1
浏览器: Edge
操作系统: Windows 10

日志

[■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ ] 100%Traceback (most recent call last):4
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\qcourse.py", line 171, in <module>
    main()
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\qcourse.py", line 123, in main
    asyncio.run(parse_course_url_and_download(course_url))
  File "C:\Users\Mitchell\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\AppData\Local\Programs\Python\Python311\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\qcourse.py", line 88, in parse_course_url_and_download
    await download_single(urls[0], urls[1], filename, path)
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\downloader.py", line 150, in download_single
    decrypt_file(str(file) + '.ts', key)
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\downloader.py", line 28, in decrypt_file
    dec = decrypt(ciphertext, key)
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\downloader.py", line 20, in decrypt
    cipher = AES.new(key, AES.MODE_CBC, iv)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\Desktop\111\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 228, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Mitchell\Desktop\111\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\Mitchell\Desktop\111\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\Mitchell\Desktop\111\qcourse_scripts-main\qcourse-venv\Lib\site-packages\Crypto\Cipher\AES.py", line 90, in _create_base_cipher
    raise ValueError("Incorrect AES key length (%d bytes)" % len(key))
ValueError: Incorrect AES key length (39 bytes)

Screenshots
image

@Kratos28
Copy link

Kratos28 commented Feb 6, 2023

同样问题.某些视频能下载,某些视频报错

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

2 participants