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

fix(quqi): empty file link for no vip user #5926

Merged
merged 4 commits into from
Jan 21, 2024
Merged

Conversation

EchoResponse
Copy link
Contributor

曲奇资源链接分为下载链接和预览链接,非VIP用户无法获取媒体资源文件(视频/图片等)的预览链接,只能获取下载链接

解决方案:先从/api/doc/getDoc接口获取预览链接,若无法获取则从/api/doc/getDownload接口获取下载链接。经过初步测试,预览链接的内容下载速度会比下载链接的快。

限制:非VIP用户同时下载的资源数量存在限制,超过限制后一定时间内禁止下载

@EchoResponse
Copy link
Contributor Author

TODO:通过CDN接口获取资源
优势:

  • 速度更快
  • 无需cookie进行权限校验
  • 理论上不会限制非VIP用户的并发下载数

劣势:

  • CDN下载内容被加密,解密算法未知(加密算法编码在wasm二进制程序中,能否在go中直接执行wasm的函数?)
  • 需要解密则依旧无法直接302重定向给客户端使用

接口:

  • 地址:https://api.quqi.com/preview/downloadInfo/url/exchange?url={url编码后的资源下载链接}
  • 响应:
{
    "err": 0,
    "msg": "success",
    "data": {
        "name": "资源名称",
        "mime": "application/octet-stream",
        "size": 75165025,
        "download_type": 1,
        "channel_type": 1,
        "channel_id": 12,
        "url": "https://dynamicoutput.quqi.com/tp7g9/TK8K9cp8gLUJcMQyqGuIFDPRbUmY6ObcUrZxP6_jGVQ/Y29zOi8vdXBsb2FkLTEyNTMyODczMTgvMjc1ZmU1YWFjYWE0NWY0OTM1YmMxZjAyZWF705809672", // CDN下载链接
        "expired_time": 1705816872,
        "is_encrypted": true,
        "encrypted_size": 75201729,
        "encrypted_alg": "c3",
        "encrypted_key": "BWEB+sAtoUlOH8hOjKlQiyGiTn0y9CGMdAGg=", // 密钥
        "passport_id": 9658017,
        "request_expired_time": 1705809702
    }
}

@EchoResponse
Copy link
Contributor Author

向项目的审核和测试道个歉~~~自己想的不够周到,测试也没做到位......

@anwen-anyi
Copy link
Contributor

anwen-anyi commented Jan 21, 2024

已测试 上传 下载 在线查看 未发现其它问题~

😹 木有必要道歉,大佬们才辛苦哩~

@xhofe xhofe merged commit d88b54d into AlistGo:main Jan 21, 2024
3 checks passed
EtherealAO pushed a commit to EtherealAO/alist that referenced this pull request Apr 12, 2024
* fix(quqi): error returned when uploading a file that existed

* fix empty download link for no vip user

* fix cannot parse request result

---------

Co-authored-by: Andy Hsu <i@nn.ci>
EtherealAO pushed a commit to EtherealAO/alist that referenced this pull request Apr 12, 2024
* fix(quqi): error returned when uploading a file that existed

* fix empty download link for no vip user

* fix cannot parse request result

---------

Co-authored-by: Andy Hsu <i@nn.ci>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants