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

请教:执行到解密一步出错 #14

Open
eta377 opened this issue Oct 10, 2021 · 10 comments
Open

请教:执行到解密一步出错 #14

eta377 opened this issue Oct 10, 2021 · 10 comments

Comments

@eta377
Copy link

eta377 commented Oct 10, 2021

周期性地出现下列提示:

Task exception was never retrieved
future: <Task finished name='Task-26' coro=<download_single() done, defined at C:\xiaochengxu\qcourse_scripts\downloader.py:76> exception=ValueError('Incorrect AES key length (53 bytes)')>
Traceback (most recent call last):
  File "C:\xiaochengxu\qcourse_scripts\downloader.py", line 82, in download_single
    decrypt_file(str(file) + '.ts', key)
  File "C:\xiaochengxu\qcourse_scripts\downloader.py", line 26, in decrypt_file
    dec = decrypt(ciphertext, key)
  File "C:\xiaochengxu\qcourse_scripts\downloader.py", line 18, in decrypt
    cipher = AES.new(key, AES.MODE_CBC, iv)
  File "C:\xiaochengxu\qcourse_scripts\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:\xiaochengxu\qcourse_scripts\qcourse-venv\lib\site-packages\Crypto\Cipher\__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "C:\xiaochengxu\qcourse_scripts\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:\xiaochengxu\qcourse_scripts\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 (53 bytes)

这种情况,应该怎么解决呢?

@aiguoli
Copy link
Owner

aiguoli commented Feb 27, 2022

很奇怪,你打开出问题的这个视频,按下F12,点网络,看看都能加载成功吗

@Haoshenqi0123
Copy link

image

同样的问题,审查元素截图。网络应该都是加载成功了的。一个章节只有一小部分视频能最终成功,

@aiguoli
Copy link
Owner

aiguoli commented Mar 8, 2022

其他课程也这样吗,或者你换个号试试,记得更新脚本

@Haoshenqi0123
Copy link

其他课程也这样吗,或者你换个号试试,记得更新脚本

其他课程也这样。其他号没有买课。3月9日更新了脚本。

@aiguoli
Copy link
Owner

aiguoli commented Mar 9, 2022

给我个出问题的课程地址,我看看

@Haoshenqi0123
Copy link

@winann
Copy link

winann commented Mar 13, 2022

这个问题有进展吗,我这儿也是一样的错误

@aiguoli
Copy link
Owner

aiguoli commented Mar 13, 2022

还有其他不成功的课程链接吗,上面的不能购买了

@o5by
Copy link

o5by commented Jun 6, 2022

@aiguoli
您好!我也遇到了同样的问题,我的登录方式是微信扫码,
在解密ts文件时候报错,我简单看了下代码,总结如下:

  1. 获取解密的key时,返回的内容是“{"msg":"用户未登录","retcode":200}”
  2. 进一步查看源码得知 GET请求 key_url 时, 查询字符串参数 token 内容的拼装来自 cookie(cookie.json)
  3. 但是在 cookie 中,没有找到键为 p_lskey、skey、p_skey 这3个cookie

猜想是不是微信登录与其他方式登录,种的cookie有区别?

@aiguoli
Copy link
Owner

aiguoli commented Jul 13, 2022

@aiguoli 您好!我也遇到了同样的问题,我的登录方式是微信扫码, 在解密ts文件时候报错,我简单看了下代码,总结如下:

  1. 获取解密的key时,返回的内容是“{"msg":"用户未登录","retcode":200}”
  2. 进一步查看源码得知 GET请求 key_url 时, 查询字符串参数 token 内容的拼装来自 cookie(cookie.json)
  3. 但是在 cookie 中,没有找到键为 p_lskey、skey、p_skey 这3个cookie

猜想是不是微信登录与其他方式登录,种的cookie有区别?

已经支持微信了,更新试试

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

5 participants