本帖最后由 伝天 于 2024-3-1 18:14 编辑
采用EncryptServer作为本地转发签名 PY改写 先运行EncryptServer 后调试源码交流群:720730863
EncryptServer 下载 https://wwi.lanzoup.com/ivgBQ1pw2wha
API接口.e
(938.69 KB, 下载次数: 4)
|
request | 文本型 | | |
method | 文本型 | | | | Url | 文本型 | | | | content | 文本型 | | | | contentType | 文本型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | now | 文本型 | | | BeSinged | 文本型 | | | headers | 文本型 | | | signature | 文本型 | | | response | 文本型 | | | JSON | 类_json | | |
now = 时间_取现行时间戳 (真) BeSinged = BeSinged + access_key + 字符 (10 ) BeSinged = BeSinged + method + 字符 (10 ) BeSinged = BeSinged + Url + 字符 (10 ) BeSinged = BeSinged + now + 字符 (10 ) 如果 (method = “POST”) BeSinged = BeSinged + contentType + 字符 (10 ) BeSinged = BeSinged + 取数据摘要 (到字节集 (content ))  BeSinged = BeSinged + “” + 字符 (10 ) + “”
response = 到文本 (网页_访问_对象 (“http://127.0.0.1:7777/encryptSign”, 1, “PrivateKey=” + 编码_URL编码 (private_key, 真, 真) + “&stringTobeSigned=” + BeSinged, , , , , , , , , , , , , , , , )) 调试输出 (response )JSON. 解析 (response, , ) 如果真 (JSON. 取属性 (“code”). 取数据文本 () ≠ “200”) 调试输出 (“签名失败”) 返回 (“签名失败”) signature = JSON. 取通用属性 (“SignData”, ) headers = headers + “x-ub-date: ” + now + 字符 (10 )headers = headers + “x-ub-authorization: ” + access_key + “:” + signature + 字符 (10 ) 如果 (method = “POST”) headers = headers + “Content-Type: ” + contentType  response = 编码_URL解码 (到文本 (网页_访问 (host + Url, 1, content, , , headers, , , , , , , , )), 真)  response = 编码_URL解码 (到文本 (网页_访问 (host + Url, 0, content, , , headers, , , , , , , , )), 真) 返回 (response )
|