alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
39.44k stars 5.12k forks source link

feat: add supports for thunderX driver #6464

Closed Three-taile-dragon closed 1 month ago

Three-taile-dragon commented 1 month ago

添加 迅雷X 存储驱动

从原 迅雷 存储驱动上修改参数得来 具体配置项可参考 迅雷存储引擎

与原 迅雷 存储引擎不同的是

ThunderX

存储配置参数方面:

ThunderXExpert

存储配置参数方面:


已知问题:

welcome[bot] commented 1 month ago

Thanks for opening this pull request! Please check out our contributing guidelines.

welcome[bot] commented 1 month ago

Congrats on merging your first pull request! We here at behavior bot are proud of you!

anwen-anyi commented 1 month ago
  1. 迅雷X 专家版也能抓包参数然后使用么?
  2. 使用 视频URL是做什么的吖?我看普通版本默认开启的,专家版(302)没开启家版(302)没开启
Three-taile-dragon commented 1 month ago
  1. 迅雷X 专家版也能抓包参数然后使用么?
  2. 使用 视频URL是做什么的吖?我看普通版本默认开启的,专家版(302)没开启家版(302)没开启

回复:

  1. 可以的,官方目前仅有APP端,抓包后填写相关参数同样可以正常使用。不过我已添加了 Algorithms 参数,在未失效的情况下,签名类型 选择 Algorithms后,可直接使用 用户名密码 登陆
  2. 视频URL 开启后,会尝试使用接口返回的媒体链接进行替换原本的链接。目前官方对 非会员 情况下,下载链接进行了限速,但视频播放是不限速的。因此可以通过替换链接的方式来避免限速,这一点对于 Alist 媒体文件下载和在线播放均生效。对于普通文件,也可以采取重命名文件后缀为媒体格式(例如:.mp4 )的方式绕过限速。专家版没默认开启 视频URL选项,目的是针对于自行配置详细参数的人群来说,应当知晓该选项的意义,因此默认不启用。对于 迅雷X 驱动默认启用该选项,更多的是为了小白用户考虑。
  3. 至于为什么 迅雷X 专家版 驱动启用了 302下载默认,而 迅雷X 驱动没有启用的问题。是考虑到 302 模式下,下载需要用到 DownUserAgent,否则无法下载。为了照顾小白用户,并没有对 迅雷X 驱动启用 302下载模式。如有需要可以使用 迅雷X 专业版
playingapi commented 1 month ago

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

anwen-anyi commented 1 month ago

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

你的账号密码不对

playingapi commented 1 month ago

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

你的账号密码不对

确定账号密码没问题

playingapi commented 1 month ago

Failed init storage: Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF

2024/05/22 21:34:49.818156 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 1 2024/05/22 21:34:54.331299 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 2 2024/05/22 21:34:58.837507 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 3 2024/05/22 21:35:03.510758 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 4 2024/05/22 21:35:03.510799 ERROR RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF

Three-taile-dragon commented 1 month ago

Failed init storage: Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF

2024/05/22 21:34:49.818156 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 1 2024/05/22 21:34:54.331299 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 2 2024/05/22 21:34:58.837507 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 3 2024/05/22 21:35:03.510758 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 4 2024/05/22 21:35:03.510799 ERROR RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF

请检查你所使用的 驱动,从你给出的报错信息中看出,你使用的应该是国内版本的 迅雷 驱动,而非 迅雷X驱动

playingapi commented 1 month ago

Failed init storage: Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF 2024/05/22 21:34:49.818156 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 1 2024/05/22 21:34:54.331299 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 2 2024/05/22 21:34:58.837507 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 3 2024/05/22 21:35:03.510758 WARN RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF, Attempt 4 2024/05/22 21:35:03.510799 ERROR RESTY Post "https://xluser-ssl.xunlei.com/v1/shield/captcha/init": EOF

请检查你所使用的 驱动,从你给出的报错信息中看出,你使用的应该是国内版本的 迅雷 驱动,而非 迅雷X驱动

原来是这样 没注意 选到迅雷专家版这个驱动了 迅雷x专家版测试没问题

anwen-anyi commented 1 month ago

忘记问大佬了, 除了根目录之外 如果要将其它目录作为根目录 ID 如何获取呢? 也没有网页端 手机版也登录不了暂时..

Three-taile-dragon commented 1 month ago

忘记问大佬了, 除了根目录之外 如果要将其它目录作为根目录 ID 如何获取呢? 也没有网页端 手机版也登录不了暂时..

抱歉,前几天比较忙,没有详细解释各项参数。现在统一解释一下。

迅雷X

  • 用户名(Username):填写为注册时的邮箱
  • 密码(Password):填写密码
  • 验证码(Captcha token):无需填写
  • 使用视频url(Use video url):默认启用(详细解释在上面的回复中已经提到了

    迅雷X专家版

  • 登录类型
  • 选择 用户(User) 时填用户名(Username)密码(Password)

下列参数均可通过抓包获取:

特别说明:根文件夹ID(Root folder id):经过测试后发现,服务器返回的是编码后的字符串,这个会随着账号不同而变动,没有通用的值。如有需要 请自行抓包获取文件夹ID (Folder id)

部分参数抓包说明:

playingapi commented 1 month ago

能把离线下载的详细参数抓一下吗

Three-taile-dragon commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"
ykxVK8yL5L commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"

实测 提示错误: ··· {"error":"captcha_invalid","error_code":9,"error_url":"","error_description":"Verification code is invalid","error_details":[]} ···

完整代码如下:

_, err := xc.Request(FILE_API_URL, http.MethodPost, func(r *resty.Request) {
        r.SetContext(ctx)
        r.SetBody(&base.Json{
            "params": &base.Json{
                "require_links": "false",
            },
            "hash":        "",
            "unionId":     "",
            "kind":        "drive#file",
            "parent_id":   "",
            "name":        args.Data,
            "upload_type": "UPLOAD_TYPE_URL",
            "url": &base.Json{
                "url":   args.Data,
                "files": []string{},
            },
            "folder_type": "DOWNLOAD",
        })
    }, nil)
Three-taile-dragon commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"

实测 提示错误: ··· {"error":"captcha_invalid","error_code":9,"error_url":"","error_description":"Verification code is invalid","error_details":[]} ···

完整代码如下:

_, err := xc.Request(FILE_API_URL, http.MethodPost, func(r *resty.Request) {
      r.SetContext(ctx)
      r.SetBody(&base.Json{
          "params": &base.Json{
              "require_links": "false",
          },
          "hash":        "",
          "unionId":     "",
          "kind":        "drive#file",
          "parent_id":   "",
          "name":        args.Data,
          "upload_type": "UPLOAD_TYPE_URL",
          "url": &base.Json{
              "url":   args.Data,
              "files": []string{},
          },
          "folder_type": "DOWNLOAD",
      })
  }, nil)

之前回复的是携带的文本内容。完整的参数如下:

X-Client-Version-Code: 20115
X-Device-Id: 
User-Agent: 
Peer-Id: 
X-System-Language: zh-CN
client_id: ZQL_zwA4qhHcoe_2
Authorization: 
X-Captcha-Token: 
x-client-id: ZQL_zwA4qhHcoe_2
X-Guid: 
Country: HK
X-Peer-Id: 
Accept-Language: zh-CN
Content-Length: 
Host: api-pan.xunleix.com
Connection: Keep-Alive
Accept-Encoding: gzip

{"kind":"drive#file","name":"","upload_type":"UPLOAD_TYPE_URL","url":{"url":"磁力链接"},"params":{},"parent_id":"父目录ID"}
ykxVK8yL5L commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"

实测 提示错误: ··· {"error":"captcha_invalid","error_code":9,"error_url":"","error_description":"Verification code is invalid","error_details":[]} ··· 完整代码如下:

_, err := xc.Request(FILE_API_URL, http.MethodPost, func(r *resty.Request) {
        r.SetContext(ctx)
        r.SetBody(&base.Json{
            "params": &base.Json{
                "require_links": "false",
            },
            "hash":        "",
            "unionId":     "",
            "kind":        "drive#file",
            "parent_id":   "",
            "name":        args.Data,
            "upload_type": "UPLOAD_TYPE_URL",
            "url": &base.Json{
                "url":   args.Data,
                "files": []string{},
            },
            "folder_type": "DOWNLOAD",
        })
    }, nil)

之前回复的是携带的文本内容。完整的参数如下:

X-Client-Version-Code: 20115
X-Device-Id: 
User-Agent: 
Peer-Id: 
X-System-Language: zh-CN
client_id: ZQL_zwA4qhHcoe_2
Authorization: 
X-Captcha-Token: 
x-client-id: ZQL_zwA4qhHcoe_2
X-Guid: 
Country: HK
X-Peer-Id: 
Accept-Language: zh-CN
Content-Length: 
Host: api-pan.xunleix.com
Connection: Keep-Alive
Accept-Encoding: gzip

{"kind":"drive#file","name":"","upload_type":"UPLOAD_TYPE_URL","url":{"url":"磁力链接"},"params":{},"parent_id":"父目录ID"}

经测 问题依旧,个人猜测是不是https://xluser-ssl.xunleix.com/v1/shield/captcha/init 这里针对上传需要传递特别的meta? 如果传递的数据中没有upload_type的参数的话不会提示验证码错误。
顺便说下 同样的代码在pikpak上没问题

Three-taile-dragon commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"

实测 提示错误: ··· {"error":"captcha_invalid","error_code":9,"error_url":"","error_description":"Verification code is invalid","error_details":[]} ··· 完整代码如下:

_, err := xc.Request(FILE_API_URL, http.MethodPost, func(r *resty.Request) {
      r.SetContext(ctx)
      r.SetBody(&base.Json{
          "params": &base.Json{
              "require_links": "false",
          },
          "hash":        "",
          "unionId":     "",
          "kind":        "drive#file",
          "parent_id":   "",
          "name":        args.Data,
          "upload_type": "UPLOAD_TYPE_URL",
          "url": &base.Json{
              "url":   args.Data,
              "files": []string{},
          },
          "folder_type": "DOWNLOAD",
      })
  }, nil)

之前回复的是携带的文本内容。完整的参数如下:

X-Client-Version-Code: 20115
X-Device-Id: 
User-Agent: 
Peer-Id: 
X-System-Language: zh-CN
client_id: ZQL_zwA4qhHcoe_2
Authorization: 
X-Captcha-Token: 
x-client-id: ZQL_zwA4qhHcoe_2
X-Guid: 
Country: HK
X-Peer-Id: 
Accept-Language: zh-CN
Content-Length: 
Host: api-pan.xunleix.com
Connection: Keep-Alive
Accept-Encoding: gzip

{"kind":"drive#file","name":"","upload_type":"UPLOAD_TYPE_URL","url":{"url":"磁力链接"},"params":{},"parent_id":"父目录ID"}

经测 问题依旧,个人猜测是不是https://xluser-ssl.xunleix.com/v1/shield/captcha/init这里针对上传需要传递特别的meta? 如果传递的数据中没有upload_type的参数的话不会提示验证码错误。

你有传递X-Captcha-TokenAuthorization参数吗? 目前Alist并不支持直接向网盘传递磁力链接进行离线,因此个人感觉,就目前来说对于迅雷X的离线相关接口的实现,意义不大。如果Alist后续支持直接传递磁力链接形式进行离线,会考虑进行适配

ykxVK8yL5L commented 1 month ago

能把离线下载的详细参数抓一下吗

添加离线下载任务的接口:https://api-pan.xunleix.com/drive/v1/files 携带文本内容:

"kind":"drive#file"
"name":""
"upload_type":"UPLOAD_TYPE_URL"
"url":{"url":"磁力链接"}
"params":{}
"parent_id":"父目录ID"

实测 提示错误: ··· {"error":"captcha_invalid","error_code":9,"error_url":"","error_description":"Verification code is invalid","error_details":[]} ··· 完整代码如下:

_, err := xc.Request(FILE_API_URL, http.MethodPost, func(r *resty.Request) {
        r.SetContext(ctx)
        r.SetBody(&base.Json{
            "params": &base.Json{
                "require_links": "false",
            },
            "hash":        "",
            "unionId":     "",
            "kind":        "drive#file",
            "parent_id":   "",
            "name":        args.Data,
            "upload_type": "UPLOAD_TYPE_URL",
            "url": &base.Json{
                "url":   args.Data,
                "files": []string{},
            },
            "folder_type": "DOWNLOAD",
        })
    }, nil)

之前回复的是携带的文本内容。完整的参数如下:

X-Client-Version-Code: 20115
X-Device-Id: 
User-Agent: 
Peer-Id: 
X-System-Language: zh-CN
client_id: ZQL_zwA4qhHcoe_2
Authorization: 
X-Captcha-Token: 
x-client-id: ZQL_zwA4qhHcoe_2
X-Guid: 
Country: HK
X-Peer-Id: 
Accept-Language: zh-CN
Content-Length: 
Host: api-pan.xunleix.com
Connection: Keep-Alive
Accept-Encoding: gzip

{"kind":"drive#file","name":"","upload_type":"UPLOAD_TYPE_URL","url":{"url":"磁力链接"},"params":{},"parent_id":"父目录ID"}

经测 问题依旧,个人猜测是不是https://xluser-ssl.xunleix.com/v1/shield/captcha/init这里针对上传需要传递特别的meta? 如果传递的数据中没有upload_type的参数的话不会提示验证码错误。

你有传递X-Captcha-TokenAuthorization参数吗? 目前Alist并不支持直接向网盘传递磁力链接进行离线,因此个人感觉,就目前来说对于迅雷X的离线相关接口的实现,意义不大。如果Alist后续支持直接传递磁力链接形式进行离线,会考虑进行适配

有传递上面的参数 body中只要没有upload_type就正常 传递upload_type提示验证码错误.
我自己fork了一份alist添加了离线下载接口,比如pikpak的storage在离线的时候选择storage类型的话会调用pikpak的离线接口,目前pikpak用和迅雷一样的离线接口是正常的. 方便的话可以抓下离线下载的包. 谢谢🙏

Three-taile-dragon commented 1 month ago

captcha_invalid

查看了你Fork的仓库的实现后,已经修复该问题:https://github.com/ykxVK8yL5L/alist/pull/1#issue-2316746097

ykxVK8yL5L commented 1 month ago

captcha_invalid

查看了你Fork的仓库的实现后,已经修复该问题:ykxVK8yL5L#1 (comment)

感谢 我今天刚测试出来 不过我是用Sub替换了UserID. 感谢 感谢 这下alist可以愉快的使用迅雷X了 🙏👍🙏👍🙏👍🙏👍🙏👍

ysw569110450 commented 2 days ago

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

你的账号密码不对

确定账号密码没问题

我出现了同样的问题,我也确定了账号密码没问题,请问解决了吗?

Three-taile-dragon commented 2 days ago

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

你的账号密码不对

确定账号密码没问题

我出现了同样的问题,我也确定了账号密码没问题,请问解决了吗?

检查下你使用的是否是 迅雷X 驱动,而不是迅雷 驱动

Three-taile-dragon commented 2 hours ago

忘记问大佬了, 除了根目录之外 如果要将其它目录作为根目录 ID 如何获取呢? 也没有网页端 手机版也登录不了暂时..

6664 部分参数发生了变化,可同步到WIKI上

anwen-anyi commented 17 minutes ago

忘记问大佬了, 除了根目录之外 如果要将其它目录作为根目录 ID 如何获取呢? 也没有网页端 手机版也登录不了暂时..

6664 部分参数发生了变化,可同步到WIKI上

好~ 记录啦 合并wiki的时候一起提交