Skip to content

迅雷网盘接口清单

来源:backend/internal/drives/xunlei.go
抓包日志:backend/logs/drive-api-debug/xunlei.txt


1. 账号登录(OAuth2 password)

接口概览

项目
方法POST
URLhttps://xluser-ssl.xunlei.com/v1/auth/signin
作用使用账号密码 + captcha_token 换取 access_token / refresh_token

请求体参数

参数说明
username手机号等,如 +86 1xxxxxxxxxx
password密码
captcha_token登录前风控验证码 token(由项目内验证码流程获取)
client_id日志为 ZUBzD9J_XPXfn7f7
client_secret日志为 yESVmHecEe6F0aou69vl-g

请求示例

bash
curl --request POST \
  --url 'https://xluser-ssl.xunlei.com/v1/auth/signin' \
  --header 'Content-Type: application/json' \
  --data '{"captcha_token":"<ck0...>","client_id":"ZUBzD9J_XPXfn7f7","client_secret":"yESVmHecEe6F0aou69vl-g","password":"<pwd>","username":"+86 1xxxxxxxxxx"}'

响应示例(失败:验证码无效)

json
{
  "error": "captcha_invalid",
  "error_code": 4002,
  "error_description": "..."
}

响应示例(成功)

json
{
  "token_type": "Bearer",
  "access_token": "<JWT>",
  "refresh_token": "<refresh>",
  "expires_in": 7200,
  "sub": "142174316",
  "user_id": "142174316"
}

2. 获取分享根信息

接口概览

项目
方法GET
URLhttps://api-pan.xunlei.com/drive/v1/share
作用校验提取码、返回分享标题、根层文件列表、pass_code_token

Query 参数

参数说明
share_id分享 ID
pass_code提取码
limit100
pass_code_token首次可为空,翻页等场景复用
page_token分页
thumbnail_sizeSIZE_SMALL

请求头

说明
X-Captcha-Token分享接口风控 token
X-Client-Id与登录一致 client_id
X-Device-Id设备 ID(代码内固定示例)
Origin / Refererhttps://pan.xunlei.com

响应示例(分享已删除)

json
{
  "share_status": "DELETED",
  "share_status_text": "分享已删除",
  "file_num": "0",
  "files": [],
  "pass_code_token": "",
  "user_info": { "user_id": "45061515", "nickname": "Sole20" }
}

响应示例(成功,根为文件夹)

json
{
  "share_status": "OK",
  "file_num": "1",
  "files": [
    {
      "kind": "drive#folder",
      "id": "VOn5EARArTr3fLkln-jFaBfcA1",
      "name": "侵略机器 War Machine (2026)",
      "size": "0",
      "folder_type": "NORMAL"
    }
  ],
  "pass_code_token": "69RM/BljR9tCoVB9wVHxJnan3BB37kNDp7Gzm5Oi3Nk...",
  "title": "侵略机器 War Machine (2026)"
}

3. 分享子目录详情

接口概览

项目
方法GET
URLhttps://api-pan.xunlei.com/drive/v1/share/detail
作用列出某 parent_id 下文件/文件夹

Query 参数

参数说明
share_id分享 ID
parent_id父文件夹 ID
limit999
pass_code_token来自 /share 响应,需 URL 编码

4. 转存分享文件到网盘

接口概览

项目
方法POST
URLhttps://api-pan.xunlei.com/drive/v1/share/restore
作用将分享中文件保存到当前用户网盘
认证Authorization: Bearer <access_token>

请求体要点(见 xunlei.go

  • share_idpass_code_tokenfile_idsto_parent_id 等。

5. 获取文件下载/直链信息

接口概览

项目
方法GET
URLhttps://x-api-pan.xunlei.com/drive/v1/files/{file_id}
作用with=url 时返回可下载地址等信息

Query 参数(示例)

参数
_magic2021
withurl
thumbnail_sizeSIZE_LARGE

认证

  • Authorization: Bearer <access_token>

6. 删除文件(回收站)

  • 方法:PATCH
  • URL:https://api-pan.xunlei.com/drive/v1/files/{file_id}/trash
  • Body:{}
  • 本次日志未单独抓取响应,待补