{ "openapi": "3.0.3", "info": { "title": "网盘快速下载服务 API", "description": "网盘快速下载服务 REST API 文档,支持多种网盘的分享链接解析,提供直链下载、预览、客户端下载链接等功能", "version": "1.0.0", "contact": { "name": "API Support", "url": "https://qaiu.top" } }, "servers": [ { "url": "http://localhost:6400", "description": "本地开发环境" }, { "url": "https://lzzz.qaiu.top", "description": "生产环境" } ], "tags": [ { "name": "解析接口", "description": "分享链接解析相关接口" }, { "name": "文件列表", "description": "文件列表相关接口" }, { "name": "预览接口", "description": "媒体文件预览相关接口" }, { "name": "客户端下载", "description": "客户端下载链接相关接口" }, { "name": "统计信息", "description": "统计信息相关接口" }, { "name": "网盘列表", "description": "支持的网盘列表接口" }, { "name": "版本信息", "description": "版本信息接口" }, { "name": "隔空喊话", "description": "隔空喊话相关接口" }, { "name": "快捷下载", "description": "快捷下载重定向接口" } ], "paths": { "/parser": { "get": { "tags": ["解析接口"], "summary": "解析分享链接(重定向)", "description": "解析分享链接并重定向到直链下载地址", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } } ], "responses": { "302": { "description": "重定向到直链下载地址", "headers": { "nfd-cache-hit": { "description": "是否命中缓存", "schema": { "type": "string", "example": "true" } }, "nfd-cache-expires": { "description": "缓存过期时间", "schema": { "type": "string", "example": "2025-01-22 12:00:00" } }, "Location": { "description": "重定向地址", "schema": { "type": "string" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/json/parser": { "get": { "tags": ["解析接口"], "summary": "解析分享链接(JSON)", "description": "解析分享链接并返回JSON格式的直链信息", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } } ], "responses": { "200": { "description": "解析成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CacheLinkInfo" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/{type}/{key}": { "get": { "tags": ["解析接口"], "summary": "根据类型和Key解析(重定向)", "description": "根据网盘类型和分享Key解析并重定向到直链", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识(如: lz, pan, cow等)", "schema": { "type": "string", "example": "lz" } }, { "name": "key", "in": "path", "required": true, "description": "分享Key,如果包含提取码,格式为 key@pwd", "schema": { "type": "string", "example": "ia2cntg" } } ], "responses": { "302": { "description": "重定向到直链下载地址", "headers": { "nfd-cache-hit": { "description": "是否命中缓存", "schema": { "type": "string" } }, "nfd-cache-expires": { "description": "缓存过期时间", "schema": { "type": "string" } }, "Location": { "description": "重定向地址", "schema": { "type": "string" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/json/{type}/{key}": { "get": { "tags": ["解析接口"], "summary": "根据类型和Key解析(JSON)", "description": "根据网盘类型和分享Key解析并返回JSON格式的直链信息", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识", "schema": { "type": "string", "example": "lz" } }, { "name": "key", "in": "path", "required": true, "description": "分享Key,如果包含提取码,格式为 key@pwd", "schema": { "type": "string", "example": "ia2cntg" } } ], "responses": { "200": { "description": "解析成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CacheLinkInfo" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/linkInfo": { "get": { "tags": ["解析接口"], "summary": "获取链接信息", "description": "获取分享链接的详细信息,包括下载链接、预览链接、统计信息等", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } } ], "responses": { "200": { "description": "获取成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/LinkInfoResp" } } } }, "500": { "description": "获取失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/getFileList": { "get": { "tags": ["文件列表"], "summary": "获取文件列表", "description": "获取分享链接中的文件列表(适用于目录分享)", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } }, { "name": "dirId", "in": "query", "required": false, "description": "目录ID,用于获取指定目录下的文件", "schema": { "type": "string", "example": "dir123" } }, { "name": "uuid", "in": "query", "required": false, "description": "UUID,某些网盘需要此参数", "schema": { "type": "string", "example": "uuid123" } } ], "responses": { "200": { "description": "获取成功", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/FileInfo" } } } } }, "500": { "description": "获取失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/view/{type}/{key}": { "get": { "tags": ["预览接口"], "summary": "预览媒体文件(按类型和Key)", "description": "预览指定类型和Key的媒体文件(图片、视频等)", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识", "schema": { "type": "string", "example": "pan" } }, { "name": "key", "in": "path", "required": true, "description": "分享Key,如果包含提取码,格式为 key@pwd", "schema": { "type": "string", "example": "1test123" } } ], "responses": { "302": { "description": "重定向到预览页面", "headers": { "Location": { "description": "预览页面地址", "schema": { "type": "string" } } } }, "500": { "description": "预览失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/preview": { "get": { "tags": ["预览接口"], "summary": "预览媒体文件(按URL)", "description": "通过分享链接预览媒体文件", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } } ], "responses": { "302": { "description": "重定向到预览页面", "headers": { "Location": { "description": "预览页面地址", "schema": { "type": "string" } } } }, "500": { "description": "预览失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/viewUrl/{type}/{param}": { "get": { "tags": ["预览接口"], "summary": "预览URL(目录预览)", "description": "预览目录中的文件,param为Base64编码的参数", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识", "schema": { "type": "string", "example": "pan" } }, { "name": "param", "in": "path", "required": true, "description": "Base64编码的参数JSON", "schema": { "type": "string", "example": "eyJmaWxlSWQiOiIxMjM0NTYifQ==" } } ], "responses": { "302": { "description": "重定向到预览页面", "headers": { "Location": { "description": "预览页面地址", "schema": { "type": "string" } } } }, "500": { "description": "预览失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/clientLinks": { "get": { "tags": ["客户端下载"], "summary": "获取所有客户端下载链接", "description": "获取所有支持的客户端格式的下载链接", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } } ], "responses": { "200": { "description": "获取成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientLinkResp" } } } }, "500": { "description": "获取失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/clientLink": { "get": { "tags": ["客户端下载"], "summary": "获取指定类型的客户端下载链接", "description": "获取指定客户端类型的下载链接", "parameters": [ { "name": "url", "in": "query", "required": true, "description": "分享链接", "schema": { "type": "string", "example": "https://pan.baidu.com/s/1test123" } }, { "name": "pwd", "in": "query", "required": false, "description": "提取码", "schema": { "type": "string", "example": "1234" } }, { "name": "clientType", "in": "query", "required": true, "description": "客户端类型 (curl, wget, aria2, idm, thunder, bitcomet, motrix, fdm, powershell)", "schema": { "type": "string", "enum": ["curl", "wget", "aria2", "idm", "thunder", "bitcomet", "motrix", "fdm", "powershell"], "example": "curl" } } ], "responses": { "200": { "description": "获取成功", "content": { "text/plain": { "schema": { "type": "string", "example": "curl -L -H \"User-Agent: Mozilla/5.0...\" -o \"test-file.zip\" \"https://example.com/file.zip\"" } } } }, "500": { "description": "获取失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/statisticsInfo": { "get": { "tags": ["统计信息"], "summary": "获取统计信息", "description": "获取系统统计信息,包括解析总数、缓存总数等", "responses": { "200": { "description": "获取成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/StatisticsInfo" } } } }, "500": { "description": "获取失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/getPanList": { "get": { "tags": ["网盘列表"], "summary": "获取支持的网盘列表", "description": "获取所有支持的网盘列表及其信息", "responses": { "200": { "description": "获取成功", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/PanInfo" } } } } } } } }, "/v2/build-version": { "get": { "tags": ["版本信息"], "summary": "获取版本号", "description": "获取应用版本号", "responses": { "200": { "description": "获取成功", "content": { "text/plain": { "schema": { "type": "string", "example": "20250121_101530" } } } } } } }, "/v2/shout/submit": { "post": { "tags": ["隔空喊话"], "summary": "提交消息", "description": "提交一条隔空喊话消息,返回6位提取码", "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": ["content"], "properties": { "content": { "type": "string", "description": "消息内容", "example": "Hello World!" } } } } } }, "responses": { "200": { "description": "提交成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/JsonResult" }, "example": { "code": 200, "msg": "success", "success": true, "data": "123456", "timestamp": 1705896000000 } } } }, "500": { "description": "提交失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/shout/retrieve": { "get": { "tags": ["隔空喊话"], "summary": "检索消息", "description": "根据提取码检索消息", "parameters": [ { "name": "code", "in": "query", "required": true, "description": "6位提取码", "schema": { "type": "string", "pattern": "^[0-9]{6}$", "example": "123456" } } ], "responses": { "200": { "description": "检索成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ShoutMessage" } } } }, "500": { "description": "检索失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/d/{type}/{key}": { "get": { "tags": ["快捷下载"], "summary": "下载重定向(短链)", "description": "短链形式的下载重定向,等同于 /:type/:key", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识", "schema": { "type": "string", "example": "lz" } }, { "name": "key", "in": "path", "required": true, "description": "分享Key,如果包含提取码,格式为 key@pwd", "schema": { "type": "string", "example": "ia2cntg" } } ], "responses": { "302": { "description": "重定向到直链下载地址", "headers": { "Location": { "description": "重定向地址", "schema": { "type": "string" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } }, "/v2/redirectUrl/{type}/{param}": { "get": { "tags": ["快捷下载"], "summary": "重定向下载URL(目录文件)", "description": "重定向到目录中指定文件的下载地址,param为Base64编码的参数", "parameters": [ { "name": "type", "in": "path", "required": true, "description": "网盘类型标识", "schema": { "type": "string", "example": "pan" } }, { "name": "param", "in": "path", "required": true, "description": "Base64编码的参数JSON", "schema": { "type": "string", "example": "eyJmaWxlSWQiOiIxMjM0NTYifQ==" } } ], "responses": { "302": { "description": "重定向到直链下载地址", "headers": { "Location": { "description": "重定向地址", "schema": { "type": "string" } } } }, "500": { "description": "解析失败", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } } } } } } } }, "components": { "schemas": { "CacheLinkInfo": { "type": "object", "properties": { "shareKey": { "type": "string", "description": "缓存key: type:ShareKey", "example": "lz:ia2cntg" }, "directLink": { "type": "string", "description": "解析后的直链", "example": "https://example.com/download/file.zip" }, "cacheHit": { "type": "boolean", "description": "是否命中缓存", "example": false }, "expires": { "type": "string", "description": "到期时间 yyyy-MM-dd hh:mm:ss", "example": "2025-01-22 12:00:00" }, "expiration": { "type": "integer", "format": "int64", "description": "有效期(毫秒)", "example": 86400000 }, "fileInfo": { "$ref": "#/components/schemas/FileInfo" } } }, "FileInfo": { "type": "object", "properties": { "fileName": { "type": "string", "description": "文件名", "example": "file.zip" }, "fileId": { "type": "string", "description": "文件ID", "example": "123456" }, "fileIcon": { "type": "string", "description": "文件图标", "example": "icon.png" }, "size": { "type": "integer", "format": "int64", "description": "文件大小(byte)", "example": 1024000 }, "sizeStr": { "type": "string", "description": "文件大小字符串", "example": "1MB" }, "fileType": { "type": "string", "description": "文件类型", "example": "zip" }, "filePath": { "type": "string", "description": "文件路径", "example": "/folder/file.zip" }, "createTime": { "type": "string", "description": "创建(上传)时间 yyyy-MM-dd HH:mm:ss格式", "example": "2025-01-21 10:00:00" }, "updateTime": { "type": "string", "description": "上次修改时间", "example": "2025-01-21 11:00:00" }, "createBy": { "type": "string", "description": "创建者", "example": "user123" }, "description": { "type": "string", "description": "文件描述" }, "downloadCount": { "type": "integer", "description": "下载次数", "example": 10 }, "panType": { "type": "string", "description": "网盘标识", "example": "lz" }, "parserUrl": { "type": "string", "description": "nfd下载链接(可能获取不到)" }, "previewUrl": { "type": "string", "description": "预览地址" }, "hash": { "type": "string", "description": "文件hash默认类型为md5" }, "extParameters": { "type": "object", "description": "扩展参数", "additionalProperties": true } } }, "LinkInfoResp": { "type": "object", "properties": { "downLink": { "type": "string", "description": "下载链接", "example": "http://127.0.0.1:6400/d/pan/1test123" }, "apiLink": { "type": "string", "description": "API链接", "example": "http://127.0.0.1:6400/json/pan/1test123" }, "viewLink": { "type": "string", "description": "预览链接", "example": "http://127.0.0.1:6400/v2/view/pan/1test123" }, "cacheHitTotal": { "type": "integer", "description": "缓存命中总数", "example": 10 }, "parserTotal": { "type": "integer", "description": "解析总数", "example": 5 }, "sumTotal": { "type": "integer", "description": "总次数", "example": 15 }, "shareLinkInfo": { "$ref": "#/components/schemas/ShareLinkInfo" } } }, "ShareLinkInfo": { "type": "object", "properties": { "shareKey": { "type": "string", "description": "分享键", "example": "1test123" }, "panName": { "type": "string", "description": "网盘名称", "example": "百度网盘" }, "type": { "type": "string", "description": "分享类型", "example": "pan" }, "sharePassword": { "type": "string", "description": "分享密码(如果存在)", "example": "1234" }, "shareUrl": { "type": "string", "description": "原始分享链接", "example": "https://pan.baidu.com/s/1test123" }, "standardUrl": { "type": "string", "description": "规范化的标准链接", "example": "https://pan.baidu.com/s/1test123" }, "otherParam": { "type": "object", "description": "其他参数", "additionalProperties": true } } }, "ClientLinkResp": { "type": "object", "properties": { "success": { "type": "boolean", "description": "是否成功", "example": true }, "error": { "type": "string", "description": "错误信息" }, "directLink": { "type": "string", "description": "直链URL", "example": "https://example.com/file.zip" }, "fileName": { "type": "string", "description": "文件名", "example": "test-file.zip" }, "fileSize": { "type": "integer", "format": "int64", "description": "文件大小", "example": 1024000 }, "clientLinks": { "type": "object", "description": "所有客户端下载链接", "additionalProperties": { "type": "string" }, "example": { "CURL": "curl -L -H \"User-Agent: Mozilla/5.0...\" -o \"test-file.zip\" \"https://example.com/file.zip\"", "POWERSHELL": "$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession...", "ARIA2": "aria2c --header=\"User-Agent: Mozilla/5.0...\" --out=\"test-file.zip\" \"https://example.com/file.zip\"" } }, "supportedClients": { "type": "object", "description": "支持的客户端类型列表", "additionalProperties": { "type": "string" }, "example": { "curl": "cURL 命令", "wget": "wget 命令", "aria2": "Aria2" } }, "parserInfo": { "type": "string", "description": "解析信息", "example": "百度网盘 - pan" } } }, "StatisticsInfo": { "type": "object", "properties": { "parserTotal": { "type": "integer", "description": "解析总数", "example": 1000 }, "cacheTotal": { "type": "integer", "description": "缓存总数", "example": 500 }, "total": { "type": "integer", "description": "总次数", "example": 1500 } } }, "PanInfo": { "type": "object", "properties": { "name": { "type": "string", "description": "网盘名", "example": "蓝奏云" }, "type": { "type": "string", "description": "网盘标识", "example": "lz" }, "shareUrlFormat": { "type": "string", "description": "分享链接格式", "example": "https://www.lanzou*.com/s/{shareKey}" }, "url": { "type": "string", "description": "网盘域名地址", "example": "https://www.lanzou.com" } } }, "ShoutMessage": { "type": "object", "properties": { "id": { "type": "integer", "format": "int64", "description": "消息ID" }, "code": { "type": "string", "description": "6位提取码", "example": "123456", "pattern": "^[0-9]{6}$" }, "content": { "type": "string", "description": "消息内容", "example": "Hello World!" }, "ip": { "type": "string", "description": "发送者IP", "example": "127.0.0.1" }, "createTime": { "type": "string", "format": "date-time", "description": "创建时间", "example": "2025-01-21T10:00:00" }, "expireTime": { "type": "string", "format": "date-time", "description": "过期时间", "example": "2025-01-22T10:00:00" }, "isUsed": { "type": "boolean", "description": "是否已使用", "example": false } } }, "JsonResult": { "type": "object", "properties": { "code": { "type": "integer", "description": "状态码", "example": 200 }, "msg": { "type": "string", "description": "消息", "example": "success" }, "success": { "type": "boolean", "description": "是否成功", "example": true }, "data": { "description": "数据", "oneOf": [ { "type": "string" }, { "type": "object" }, { "type": "array" } ] }, "timestamp": { "type": "integer", "format": "int64", "description": "时间戳", "example": 1705896000000 } } }, "ErrorResponse": { "type": "object", "properties": { "code": { "type": "integer", "description": "错误状态码", "example": 500 }, "msg": { "type": "string", "description": "错误消息", "example": "解析分享链接失败: 具体错误信息" }, "success": { "type": "boolean", "description": "是否成功", "example": false }, "data": { "type": "object", "nullable": true }, "timestamp": { "type": "integer", "format": "int64", "description": "时间戳", "example": 1705896000000 } } } } } }