蓝奏云解析接口本地搭建
来源:https://www.52pojie.cn/thread-2107997-1-1.html ###2026.5.17 更新文件夹和子文件解析 # 蓝奏云直链解析 API 客户端文档 ## 基础信息 - 基础地址:`http://127.0.0.1:8787` - 端口可通过 `--port` 或环境变量 `PORT` 修改 ## 端点 | 方法 | 路径 | 说明 | |------|--…
来源:https://www.52pojie.cn/thread-2107997-1-1.html
###2026.5.17 更新文件夹和子文件解析
# 蓝奏云直链解析 API 客户端文档
## 基础信息
- 基础地址:`http://127.0.0.1:8787`
- 端口可通过 `--port` 或环境变量 `PORT` 修改
## 端点
| 方法 | 路径 | 说明 |
|------|------|------|
| GET | `/api/resolve` | 解析分享链接 |
| POST | `/api/resolve` | 解析分享链接(JSON Body) |
| GET | `/health` | 健康检查 |
## 参数
| 参数 | 类型 | 必填 | 说明 |
|------|------|------|------|
| `url` | string | 是 | 蓝奏云分享链接 |
| `pwd` | string | 否 | 访问密码 |
| `expand` | string | 否 | 文件夹模式下设为 `1`,获取全部文件直链 |
| `file` | string | 否 | 文件夹模式下指定文件 ID,只解析该文件 |
| `file_pwd` | string | 否 | 文件夹内有独立密码的文件密码 |
> POST 请求 Body 示例:`{"url":"https://...","pwd":"52PJ","expand":true}`
## 使用示例
### 1. 解析单个文件
**无密码**:
```powershell
curl "http://127.0.0.1:8787/api/resolve?url=https://huanhai.lanzouq.com/itCiO3npvz4h"
```
**带密码**:
```powershell
curl "http://127.0.0.1:8787/api/resolve?url=https://huanhai.lanzouq.com/i35gf3ocrmuj&pwd=hm9d"
```
返回:
```json
{
"ok": true,
"type": "file",
"directUrl": "https://exe1.webgetstore.com/...exe?...",
"fileId": "283431317",
"input": { "url": "...", "hasPassword": false }
}
```
### 2. 解析文件夹
```powershell
curl "http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/b00yavmsjg&pwd=52PJ"
```
返回:
```json
{
"ok": true,
"type": "folder",
"name": "文本编辑工具",
"count": 10,
"files": [
{
"id": "icwf13p6ig3c",
"name": "rj-16.60-portable.exe",
"size": "50.8 M",
"shareUrl": "https://wwbrr.lanzouw.com/icwf13p6ig3c?webpage=..."
}
]
}
```
### 3. 文件夹全部文件直链
```powershell
curl "http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/b00yavmsjg&pwd=52PJ&expand=1"
```
每个文件额外返回 `directUrl`,解析失败的文件返回 `error` 字段。
### 4. 文件夹内单个文件直链
**方式 **:用 `shareUrl`(含 `?webpage=` 参数,无需密码)
```powershell
curl "http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/icwf13p6ig3c?webpage=U2JaO..."
```
## 返回字段
| 字段 | 类型 | 说明 |
|------|------|------|
| `ok` | boolean | 是否成功 |
| `type` | string | `file` 或 `folder` |
| `directUrl` | string | 文件直链(仅 type=file 或 expand=1) |
| `fileId` | string | 文件 ID |
| `name` | string | 文件/文件夹名 |
| `count` | number | 文件数量(仅 folder) |
| `files` | array | 文件列表(仅 folder) |
| `files[].id` | string | 文件 ID |
| `files[].name` | string | 文件名 |
| `files[].size` | string | 文件大小 |
| `files[].shareUrl` | string | 分享链接(含 `?webpage=` 免密参数) |
| `files[].directUrl` | string | 直链(expand=1 时返回) |
| `files[].error` | string | 错误信息(解析失败时返回) |
## 注意事项
- `shareUrl` 中的 `?webpage=` 参数是密码绕过令牌,用它访问无需再输密码
- `expand=1` 为串行解析,文件较多时耗时较长
- 文件夹内个别文件可能有独立密码,需用 `file_pwd` 参数单独传入
下载地址: https://huanhai.lanzouq.com/iSfnr3ppmyqb
下载地址
- http://127.0.0.1:8787/api/resolve?url=https://huanhai.lanzouq.com/itCiO3npvz4h"
- http://127.0.0.1:8787/api/resolve?url=https://huanhai.lanzouq.com/i35gf3ocrmuj&pwd=hm9d"
- http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/b00yavmsjg&pwd=52PJ"
- https://wwbrr.lanzouw.com/icwf13p6ig3c?webpage=..."
- http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/b00yavmsjg&pwd=52PJ&expand=1"
- http://127.0.0.1:8787/api/resolve?url=https://wwbrr.lanzouw.com/icwf13p6ig3c?webpage=U2JaO..."
- https://huanhai.lanzouq.com/iSfnr3ppmyqb