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

feat: add supports for thunderX driver #6464

Merged
merged 1 commit into from
May 21, 2024
Merged

feat: add supports for thunderX driver #6464

merged 1 commit into from
May 21, 2024

Conversation

Three-taile-dragon
Copy link
Contributor

添加 迅雷X 存储驱动

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

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

ThunderX

存储配置参数方面:

  • Username: 由原来的 手机号 改为 邮箱
  • Captcha token: 现在无需手动填写

ThunderXExpert

存储配置参数方面:

  • Username: 由原来的 手机号 改为 邮箱

已知问题:

  • 官方目前暂未开放上传功能,无法上传

Copy link

welcome bot commented May 17, 2024

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

@xhofe xhofe merged commit bbe3d4e into AlistGo:main May 21, 2024
3 checks passed
Copy link

welcome bot commented May 21, 2024

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

@anwen-anyi
Copy link
Contributor

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

@Three-taile-dragon
Copy link
Contributor Author

  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
Copy link

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

@anwen-anyi
Copy link
Contributor

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

你的账号密码不对

@playingapi
Copy link

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

你的账号密码不对

确定账号密码没问题

@playingapi
Copy link

playingapi commented May 22, 2024

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
Copy link
Contributor Author

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
Copy link

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
Copy link
Contributor

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

@Three-taile-dragon
Copy link
Contributor Author

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


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

迅雷X

迅雷X专家版

  • 登录类型

    • 选择 用户(User) 时填用户名(Username)密码(Password)

    • 选择 刷新令牌(Refresh token) 时只需填写 刷新令牌(Refresh token)

  • 签名类型

    • 选择 算法(Algorithms) 时需填写 算法(Algorithms)

    • 选择 验证码签名(Captcha sign) 时只需填写 验证码签名(Captcha sign)时间戳(Timestamp)

  • 验证码(Captcha token) :无需填写

  • 设备id(Device id):通过 MD5 计算的值,用于判断登录的设备

  • 客户端ID(Client id), 客户端密钥(Client secret), 客户端版本(Client version), 包名(Package name):与签名有关,根据实际情况填写

  • 用户代理(User agent):API 请求使用的 User Agent,设置错误可能无法访问或限速

  • 下载用户代理(Download user agent):下载时用到的 User Agent,如果设置错误会无法下载(开启代理会使用) 固定参数:Dalvik/2.1.0 (Linux; U; Android 12; M2004J7AC Build/SP1A.210812.016)

  • 使用视频url(Use video url)默认不启用,如有需要请自行启用(详细解释在上面的回复中已经提到了


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

  • 验证码签名(Captcha sign)
  • 时间戳(Timestamp)
  • 设备id(Device id)
  • 客户端ID(Client id)
  • 客户端密钥(Client secret)
  • 客户端版本(Client version)
  • 包名(Package name)
  • 用户代理(User agent)
  • 根文件夹ID(Root folder id)

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


部分参数抓包说明:

  • 抓包请求中的https://xluser-ssl.xunleix.com/v1/shield/captcha/init,可以得到下面参数
    • x_1
    • 客户端ID(Client id)
    • 设备id(Device id)
    • 验证码签名(Captcha sign)
    • 包名(Package name)
    • 客户端版本(Client version)
    • 时间戳(Timestamp)
  • 抓包请求中的https://xluser-ssl.xunleix.com/v1/auth/signin,可以得到下面的参数
    • x_2
    • 客户端ID(Client id)
    • 客户端密钥(Client secret)
  • 抓包请求中的https://api-pan.xunleix.com/drive/v1/files?parent_id=&page_token=&filters=,可以得到下面参数
    • x_3
    • 文件夹ID(id)
    • 父文件夹ID(parent_id)
    • 文件夹名称(name)
    • 注意:根目录下获取的文件夹ID(Folder id)(例如:我接收的文件我的云盘高速云下载),这个会随着账号不同而变动,没有通用的值

@playingapi
Copy link

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

@Three-taile-dragon
Copy link
Contributor Author

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

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

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

@ykxVK8yL5L
Copy link

ykxVK8yL5L commented May 24, 2024

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

添加离线下载任务的接口: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
Copy link
Contributor Author

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

添加离线下载任务的接口: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
Copy link

ykxVK8yL5L commented May 24, 2024

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

添加离线下载任务的接口: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
Copy link
Contributor Author

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

添加离线下载任务的接口: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
Copy link

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

添加离线下载任务的接口: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
Copy link
Contributor Author

captcha_invalid

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

@ykxVK8yL5L
Copy link

captcha_invalid

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

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

@ysw569110450
Copy link

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

你的账号密码不对

确定账号密码没问题

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

@Three-taile-dragon
Copy link
Contributor Author

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

你的账号密码不对

确定账号密码没问题

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

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

@Three-taile-dragon
Copy link
Contributor Author

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

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

@anwen-anyi
Copy link
Contributor

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

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

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

@viqbgrg
Copy link

viqbgrg commented Jul 9, 2024

#6648 pikpak可以离线下载了,迅雷能不能也支持离线下载

@ykxVK8yL5L
Copy link

#6648 pikpak可以离线下载了,迅雷能不能也支持离线下载

有支持的 https://youtu.be/5lh2o9Z_Kds?si=gGTz-AN2X0R69-03

@viqbgrg
Copy link

viqbgrg commented Jul 9, 2024

#6648 pikpak可以离线下载了,迅雷能不能也支持离线下载

有支持的 https://youtu.be/5lh2o9Z_Kds?si=gGTz-AN2X0R69-03

有没有合并过来

@ykxVK8yL5L
Copy link

#6648 pikpak可以离线下载了,迅雷能不能也支持离线下载

有支持的 https://youtu.be/5lh2o9Z_Kds?si=gGTz-AN2X0R69-03

有没有合并过来

没有 改动比较大 当全新版用吧

@jokunhe
Copy link

jokunhe commented Sep 9, 2024

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

Your account password is incorrect

Make sure the account password is OK

I have the same problem, and I have confirmed that the account password is fine, has it been solved?

Check if you are using the 'Thunderbolt X' driver instead of the 'Thunderbolt' driver

Same problem with the use of Thunderbolt X driver> > > > > Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed

你的账号密码不对

确定账号密码没问题

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

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

同样的问题,使用的迅雷X驱动 然h

Failed init storage: ErrorCode: 4022 ,Error: invalid_account_or_password ,ErrorDescription: verification failed初始化存储失败:ErrorCode:4022,错误:invalid_account_or_password,ErrorDescription:验证失败

你的账号密码不对

确定账号密码没问题

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

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

同样的问题,确定使用的是 迅雷X 驱动,然后账号密码确定很多次, 还是提示同样的4022

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.

8 participants