Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

由于签名等问题,导致的在线播放视频、下载失效?解决思路参考。。。 #54

Open
jkqxl opened this issue Feb 14, 2023 · 0 comments

Comments

@jkqxl
Copy link

jkqxl commented Feb 14, 2023

2023年2月13日更新,导致原网页版接口失效,但吾爱上的大神已经给出了具体的解决办法,个人不太懂代码,作者如有意更新,可参考下。

地址:
https://www.52pojie.cn/thread-1745677-1-1.html
https://github.com/kazutoiris/ali_ecc

说下结果

STEP1 生成密钥对

private_key = random.randint(1, 2**256-1)
ecc_pri = ecdsa.SigningKey.from_secret_exponent(
    private_key, curve=ecdsa.SECP256k1)

STEP2 生成并处理公钥

ecc_pub = ecc_pri.get_verifying_key()
public_key = "04"+ecc_pub.to_string().hex()

STEP3 签名

def sign(appId, deviceId, userId, nonce) -> str:
    sign_dat = ecc_pri.sign(r(appId, deviceId, userId, nonce).encode('utf-8'), entropy=None,
                            hashfunc=hashlib.sha256)
    return sign_dat.hex()+"01"

非对称签名每次签同样的内容产生的签名是不一样的,但是似乎阿里云盘直接简单处理了。
create_session 时候用的 x-signature 必须原封不动的传递到其他 API 的调用上,否则就算是密钥对一致、内容一致,也只会报无效。

其它的
似乎油猴脚本下载不受影响。
AList通过分享创建的也不受影响。

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

No branches or pull requests

1 participant