Skip to content

天翼云盘接口清单

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


1. 根据分享码取分享信息

接口概览

项目
方法GET
URLhttps://cloud.189.cn/api/open/share/getShareInfoByCodeV2.action
作用返回分享文件夹元数据、shareIdfileId、是否需要访问码等

Query 参数

参数说明
shareCode分享短码
noCache时间戳防缓存,如 1775183692.202527

请求头(常见)

  • Browser-IdSign-Type: 1Referer: https://cloud.189.cn/t/<shareCode>

请求示例

bash
curl --request GET \
  --url 'https://cloud.189.cn/api/open/share/getShareInfoByCodeV2.action?shareCode=<code>&noCache=<ts>' \
  --header 'Accept: application/json;charset=UTF-8' \
  --header 'Referer: https://cloud.189.cn/t/<code>'

响应示例

json
{
  "res_code": 0,
  "res_message": "成功",
  "accessCode": "",
  "fileId": "123421237241992669",
  "fileName": "War Machine (2026) 4K DV P5 ...",
  "isFolder": true,
  "needAccessCode": 1,
  "shareId": 12420120162064,
  "shareMode": 3,
  "shareType": 1,
  "creator": {
    "nickName": "分享者昵称",
    "ownerAccount": "189****1962@189.cn"
  }
}

2. 分享目录列表

接口概览

项目
方法GET
URLhttps://cloud.189.cn/api/open/share/listShareDir.action
作用列出分享目录下文件与子文件夹

Query 参数(日志示例)

参数说明
fileId / shareDirFileId当前分享目录 ID
shareId分享 ID
isFoldertrue
shareMode3
pageNum / pageSize分页
orderBy / descending排序
accessCode访问码,无则空
iconOption5
noCache时间戳

响应示例(节选)

json
{
  "res_code": 0,
  "res_message": "成功",
  "fileListAO": {
    "count": 1,
    "fileList": [
      {
        "id": "723421237241992672",
        "name": "War.Machine.2026.2160p.WEB-DL.DV.HEVC.DDP.5.1.Atmos-NF@WF.mkv",
        "size": 15841851851,
        "mediaType": 3,
        "md5": "ED9101086EE5F32A8993E7125775C33F"
      }
    ],
    "folderList": []
  }
}

接口概览

项目
方法GET
URLhttps://cloud.189.cn/api/portal/getNewVlcVideoPlayUrl.action
作用换取播放相关地址(日志中在 Session 无效时返回 400)

Query 参数

参数说明
shareId分享 ID
fileId文件 ID
dt日志为 1
type日志为 4
noCache时间戳

响应示例(Session 无效)

json
{
  "errorCode": "InvalidSessionKey",
  "errorMsg": "cookieUserSession is null or invalid, cookieUserSession=null",
  "success": null
}

成功场景需携带登录后 cloud.189.cn / .e.189.cn 域 Cookie,响应结构待有效会话下补录。


4. 账号登录相关(open.e.189.cn,日志片段)

实现会访问链式页面与接口,包括但不限于:

  • GET https://cloud.189.cn/api/portal/loginUrl.action?redirectURL=...
  • GET https://open.e.189.cn/api/logbox/oauth2/unifyAccountLogin.do?...
  • GET https://open.e.189.cn/api/logbox/separate/web/index.html?...
  • POST https://open.e.189.cn/api/logbox/oauth2/appConf.do
  • POST https://open.e.189.cn/api/logbox/config/encryptConf.do
  • POST https://open.e.189.cn/api/logbox/oauth2/loginSubmit.do(表单含加密字段 epd 等)
  • GET https://cloud.189.cn/api/portal/callbackUnify.action?...(回调带票据)

具体表单字段与加密规则以 tianyi.go / auth/tianyi.go 为准;完整 JSON 响应建议在有头有尾的登录抓包中再写入文档。