{
 "openapi": "3.0.3",
 "info": {
  "title": "工具站大全 免费接口",
  "version": "1.0",
  "description": "免费公开接口，每个 IP 每分钟最多 20 次解析请求。服务器接口地址会变化：先读取 https://wan.is-my.app/live.json 的 urls 列表，依次请求 {地址}/dl/healthz，第一个返回 200 的就是当前可用地址（下文记作 {BASE}）。"
 },
 "servers": [
  {
   "url": "{BASE}",
   "variables": {
    "BASE": {
     "default": "https://aiym.dpdns.org",
     "description": "从 https://wan.is-my.app/live.json 获取"
    }
   }
  }
 ],
 "paths": {
  "/dl/api/parse": {
   "get": {
    "summary": "视频解析（抖音无水印、X/Twitter、B站、快手、微博、YouTube 等）",
    "operationId": "parseVideo",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "分享链接或整段分享文字"
     }
    ],
    "responses": {
     "200": {
      "description": "解析结果",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          },
          "platform": {
           "type": "string"
          },
          "title": {
           "type": "string"
          },
          "author": {
           "type": "string"
          },
          "cover": {
           "type": "string"
          },
          "videos": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "url": {
              "type": "string"
             },
             "label": {
              "type": "string"
             },
             "ext": {
              "type": "string"
             }
            }
           }
          },
          "images": {
           "type": "array",
           "items": {
            "type": "string"
           }
          },
          "audio": {
           "type": "string"
          },
          "error": {
           "type": "string"
          }
         }
        }
       }
      }
     },
     "429": {
      "description": "请求太频繁"
     }
    }
   }
  },
  "/dl/api/file": {
   "get": {
    "summary": "下载解析出的视频/图片/音频（流式转发）",
    "operationId": "downloadFile",
    "parameters": [
     {
      "name": "u",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "parse 返回的 videos[].url / images[] / audio"
     },
     {
      "name": "name",
      "in": "query",
      "schema": {
       "type": "string"
      },
      "description": "保存的文件名"
     }
    ],
    "responses": {
     "200": {
      "description": "文件内容"
     }
    }
   }
  },
  "/dl/api/media": {
   "post": {
    "summary": "创建自媒体处理任务（上传文件）：视频/音频转文字、拆解脚本、提取 MP3、截取封面",
    "operationId": "createMediaJobUpload",
    "parameters": [
     {
      "name": "task",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "asr",
        "script",
        "mp3",
        "cover",
        "frames"
       ]
      }
     }
    ],
    "requestBody": {
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "{ok, id}"
     },
     "429": {
      "description": "超出频率（每 IP 每小时 8 个任务）"
     }
    }
   },
   "get": {
    "summary": "创建自媒体处理任务（视频链接）",
    "operationId": "createMediaJobFromUrl",
    "parameters": [
     {
      "name": "task",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "asr",
        "script",
        "mp3",
        "cover",
        "frames"
       ]
      }
     },
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "抖音 / B站 / X 等分享链接"
     },
     {
      "name": "scene",
      "in": "query",
      "schema": {
       "type": "number",
       "default": 0.3
      },
      "description": "拆解脚本的镜头灵敏度 0.1–0.9"
     }
    ],
    "responses": {
     "200": {
      "description": "{ok, id, queue, limit_seconds}"
     }
    }
   }
  },
  "/dl/api/media/{id}": {
   "get": {
    "summary": "查询任务进度和结果（state: queued/running/done/error；done 时含 text、segments、shots、files）",
    "operationId": "getMediaJob",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "状态"
     }
    }
   }
  },
  "/dl/api/media/{id}/{file}": {
   "get": {
    "summary": "下载任务结果文件（transcript.txt/srt/vtt、script.zip/csv/md、audio.mp3、*.jpg）",
    "operationId": "getMediaFile",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "file",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "文件"
     }
    }
   }
  },
  "/dl/healthz": {
   "get": {
    "summary": "健康检查",
    "operationId": "health",
    "responses": {
     "200": {
      "description": "ok"
     }
    }
   }
  }
 }
}