Compare commits

...

1 Commits

Author SHA1 Message Date
caorushizi 8f6ac6346a docs: refresh VitePress homepages and add download API reference
A batch of VitePress site updates around the v3.5.0 release:

- Refresh the zh / en / jp homepages into a 3x3 feature grid aligned
  with README v3.5.0: keep the foundational "no packet capture /
  batch download / mobile playback" cards, add v3.5.0 pillars
  (browser extension / broad video source coverage / OpenClaw Skill /
  HTTP API / built-in format conversion / one-line Docker). Rewrite
  the hero with a tighter "cross-platform video downloader + built-in
  sniffing" tagline and point the English hero at the
  English-localized `home_en.png`.
- Fix en / jp hero action links that previously routed to the Chinese
  root pages (`/guides` → `/en/guides`, `/jp/guides` etc.).
- Add the macOS usage block to the en / jp quick-start guides
  (Intel vs Apple Silicon + `sudo xattr -dr com.apple.quarantine`
  unblock command), and drop the QQ feedback group tip from those
  locales — QQ is China-only, not useful for en / jp audiences.
- Add a new Download API reference page (`/api`) for all three locales,
  registered in the sidebar under "开始 / Quick start / 始める".
  Covers Base URL (desktop `39719`, Docker `9900`), auth (API key from
  Settings page), curl quick-start, download SSE events, and the full
  `/api/downloads/*` endpoint reference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 01:10:32 +08:00
10 changed files with 1007 additions and 59 deletions
+3
View File
@@ -31,6 +31,7 @@ export default defineConfig({
items: [
{ text: "快速开始", link: "/guides" },
{ text: "使用说明", link: "/documents" },
{ text: "下载接口", link: "/api" },
{ text: "更新日志", link: "/changelog" },
{ text: "通过宝塔面板部署", link: "/bt-install" },
{ text: "浏览器扩展", link: "/extension" },
@@ -76,6 +77,7 @@ export default defineConfig({
{ text: "Quick start", link: "/en/guides" },
{ text: "Baota Panel", link: "/en/bt-install" },
{ text: "Documents", link: "/en/documents" },
{ text: "Download API", link: "/en/api" },
{ text: "Changelog", link: "/en/changelog" },
{ text: "Browser extension", link: "/en/extension" },
{ text: "🦞 OpenClaw Skill", link: "/en/skills" },
@@ -116,6 +118,7 @@ export default defineConfig({
{ text: "早く始めます", link: "/jp/guides" },
{ text: "塔のパネル配置です", link: "/jp/bt-install" },
{ text: "使用説明書です", link: "/jp/documents" },
{ text: "ダウンロード API", link: "/jp/api" },
{ text: "ログを更新します。", link: "/jp/changelog" },
{ text: "ブラウザ拡張機能", link: "/jp/extension" },
{ text: "🦞 OpenClaw Skill", link: "/jp/skills" },
+302
View File
@@ -0,0 +1,302 @@
---
layout: doc
outline: deep
---
# 下载接口
MediaGo 把下载核心暴露成一个 HTTP 服务。桌面端在 `39719` 端口,Docker 部署在 `9900` 端口。
你可以用任何支持 HTTP 的工具(curl / Python / Node.js / Postman 等)直接调用接口,新建下载任务、启动、停止、查询进度 —— MediaGo 自己的浏览器扩展、AI Skill 都是这套接口的消费者。
## 基础信息
### 接口地址
| 部署方式 | Base URL |
| -------- | ---------------------------------------------------- |
| 桌面端 | `http://localhost:39719` |
| Docker | `http://<服务器地址>:9900`(按实际 `-p` 端口映射调整) |
所有接口都在 `/api` 前缀下。下文示例默认用桌面端的 `39719` 端口,Docker 部署请自行替换。
### 响应格式
所有 `/api/*` 接口都返回统一的 JSON 包裹结构:
```json
{
"success": true,
"code": 0,
"message": "ok",
"data": { ... }
}
```
| 字段 | 类型 | 说明 |
| --------- | ------ | --------------------------- |
| `success` | bool | 业务是否成功 |
| `code` | number | 业务错误码,`0` 表示成功 |
| `message` | string | 人类可读的提示 |
| `data` | any | 实际响应载荷,结构因接口而异 |
下文示例中的"响应"只展示 `data` 字段的内容。
### 认证
- **桌面端**:默认**无需认证**,直接请求 `localhost:39719` 即可
- **Docker 部署**:启用认证时,在 MediaGo **设置页面**中获取 API Key,之后的请求带 `Authorization: Bearer <key>`
## 快速上手
下面这三条命令串起"新建 → 开始下载 → 完成通知"的完整流程。
### 1. 新建下载任务
```bash
curl -X POST http://localhost:39719/api/downloads \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"name": "我的视频"
}
],
"startDownload": true
}'
```
- `type`:下载类型,可选 `m3u8` / `bilibili` / `direct` / `youtube` / `mediago`
- `url`:视频链接
- `name`:任务名称(会作为保存文件名)
- `startDownload`:创建后是否立即开始下载
响应:
```json
[
{
"id": 123,
"name": "我的视频",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"status": "waiting",
"createdDate": "2026-04-23T10:00:00Z"
}
]
```
记下返回的 `id`,后续接口会用到。
### 2. 订阅下载事件(SSE)
```bash
curl -N http://localhost:39719/api/events
```
这是一条长连接,服务端推什么、你收什么:
```text
event: download-start
data: {"id": "123"}
event: download-success
data: {"id": "123"}
```
浏览器 / Node.js 里:
```javascript
const es = new EventSource("http://localhost:39719/api/events");
es.addEventListener("download-success", (e) => {
const { id } = JSON.parse(e.data);
console.log("任务完成:", id);
});
```
### 3. 查询状态 / 手动控制
```bash
# 列出所有下载任务(分页)
curl "http://localhost:39719/api/downloads?current=1&pageSize=20"
# 查单个任务
curl http://localhost:39719/api/downloads/123
# 启动已存在的任务
curl -X POST http://localhost:39719/api/downloads/123/start \
-H "Content-Type: application/json" \
-d '{"localPath": "/Downloads/MediaGo", "deleteSegments": true}'
# 停止任务
curl -X POST http://localhost:39719/api/downloads/123/stop
# 查下载日志
curl http://localhost:39719/api/downloads/123/logs
```
## 下载事件
`GET /api/events` 是 Server-Sent Events 流,下载相关的事件:
| 事件名 | 载荷 | 说明 |
| ------------------ | -------------------------------- | ------------ |
| `download-create` | `{ids: number[], count: number}` | 批量创建任务 |
| `download-start` | `{id: string}` | 下载开始 |
| `download-success` | `{id: string}` | 下载成功 |
| `download-failed` | `{id: string, error: string}` | 下载失败 |
| `download-stop` | `{id: string}` | 下载手动停止 |
## 接口参考
### 列表 / 查询
#### `GET /api/downloads` — 分页列出下载任务
**Query 参数:**
- `current` (number, 默认 1):页码
- `pageSize` (number, 默认 20):每页条数
- `filter` (string, 可选):按状态筛选,如 `downloading` / `success` / `failed`
- `localPath` (string, 可选):按保存路径筛选
**响应:**
```json
{
"total": 42,
"list": [
/* DownloadTask[] */
]
}
```
#### `GET /api/downloads/active` — 列出活动中的任务
返回所有 `waiting` / `downloading` 状态的任务。
#### `GET /api/downloads/:id` — 查单个任务
**响应**(`DownloadTask` 结构):
```json
{
"id": 123,
"name": "我的视频",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"folder": "my-folder",
"headers": "User-Agent: ...",
"isLive": false,
"status": "success",
"file": "/path/to/saved.mp4",
"createdDate": "2026-04-23T10:00:00Z",
"updatedDate": "2026-04-23T10:05:30Z"
}
```
#### `GET /api/downloads/folders` — 列出所有不重复的保存目录
**响应:** `string[]`
#### `GET /api/downloads/export` — 导出下载列表
返回纯文本,每行一个 URL。
#### `GET /api/downloads/:id/logs` — 查下载日志
**响应:** `{ id, log: string }`
### 创建 / 删除
#### `POST /api/downloads` — 批量新建下载
**请求体:**
```json
{
"tasks": [
{
"type": "m3u8 | bilibili | direct | youtube | mediago",
"url": "https://example.com/video.m3u8",
"name": "任务名",
"folder": "可选子目录",
"headers": "可选,多行 HTTP 头"
}
],
"startDownload": true
}
```
**响应:** `DownloadTask[]`
#### `DELETE /api/downloads/:id` — 删除任务
**响应:** `{}`
### 编辑 / 状态
#### `PUT /api/downloads/:id` — 编辑任务
**请求体**(字段都可选):
```json
{
"name": "新名字",
"url": "新 URL",
"headers": "新的 headers",
"folder": "新的子目录"
}
```
#### `PUT /api/downloads/:id/live` — 标记 / 取消直播流
**请求体:** `{ "isLive": true }`
#### `PUT /api/downloads/status` — 批量修改任务状态
**请求体:** `{ "ids": number[], "status": "waiting | downloading | success | failed | stopped" }`
### 启动 / 停止
#### `POST /api/downloads/:id/start` — 启动下载
**请求体:**
```json
{
"localPath": "/Users/me/Downloads/MediaGo",
"deleteSegments": true
}
```
- `localPath`:保存到哪里(绝对路径)
- `deleteSegments`:m3u8 下载完成后是否删除分段 `.ts` 文件
#### `POST /api/downloads/:id/stop` — 停止下载
**响应:** `{}`
## 枚举值
### 下载类型 `type`
| 值 | 说明 |
| ---------- | ----------------------------------- |
| `m3u8` | HLS 流媒体(底层 N_m3u8DL-RE) |
| `bilibili` | B 站视频(底层 BBDown) |
| `direct` | 直接 HTTP 下载(底层 aria2) |
| `youtube` | YouTube 及 yt-dlp 支持的 1000+ 站点 |
| `mediago` | MediaGo 内部类型 |
### 任务状态 `status`
| 值 | 说明 |
| ------------- | ---------- |
| `waiting` | 等待开始 |
| `downloading` | 下载中 |
| `success` | 已完成 |
| `failed` | 失败 |
| `stopped` | 已手动停止 |
+302
View File
@@ -0,0 +1,302 @@
---
layout: doc
outline: deep
---
# Download API
MediaGo exposes its download engine as an HTTP service. The desktop app listens on port `39719`; the Docker deployment listens on port `9900`.
You can drive it from anything that speaks HTTP — curl, Python, Node.js, Postman, your own scripts, automation platforms. MediaGo's own browser extension and AI Skill are just consumers of this API.
## Basics
### Base URL
| Deployment | Base URL |
| ---------- | ------------------------------------------------------- |
| Desktop | `http://localhost:39719` |
| Docker | `http://<your-host>:9900` (adjust to your port mapping) |
All endpoints live under the `/api` prefix. The examples below use the desktop port `39719` by default — swap in your Docker port if that's what you're targeting.
### Response envelope
Every `/api/*` endpoint returns this JSON wrapper:
```json
{
"success": true,
"code": 0,
"message": "ok",
"data": { ... }
}
```
| Field | Type | Notes |
| --------- | ------ | ---------------------------------------------- |
| `success` | bool | Whether the call succeeded |
| `code` | number | Business error code, `0` on success |
| `message` | string | Human-readable hint |
| `data` | any | The actual payload — shape varies per endpoint |
Example responses below only show the `data` body.
### Authentication
- **Desktop**: no auth by default, just hit `localhost:39719`
- **Docker**: when auth is enabled, grab the API key from MediaGo's **Settings** page, then include `Authorization: Bearer <key>` on every request
## Quick start
Three curl commands that walk through the whole "create → download → get notified" flow.
### 1. Create a download task
```bash
curl -X POST http://localhost:39719/api/downloads \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"name": "My Video"
}
],
"startDownload": true
}'
```
- `type`: download type — `m3u8` / `bilibili` / `direct` / `youtube` / `mediago`
- `url`: video URL
- `name`: task name (used as the saved file name)
- `startDownload`: whether to start immediately after creation
Response:
```json
[
{
"id": 123,
"name": "My Video",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"status": "waiting",
"createdDate": "2026-04-23T10:00:00Z"
}
]
```
Keep the `id` — you'll need it later.
### 2. Subscribe to download events (SSE)
```bash
curl -N http://localhost:39719/api/events
```
A long-lived connection — whatever the server emits, you receive:
```text
event: download-start
data: {"id": "123"}
event: download-success
data: {"id": "123"}
```
In the browser / Node.js:
```javascript
const es = new EventSource("http://localhost:39719/api/events");
es.addEventListener("download-success", (e) => {
const { id } = JSON.parse(e.data);
console.log("Done:", id);
});
```
### 3. Query / manually control
```bash
# List all downloads (paginated)
curl "http://localhost:39719/api/downloads?current=1&pageSize=20"
# Get one task
curl http://localhost:39719/api/downloads/123
# Start an existing task
curl -X POST http://localhost:39719/api/downloads/123/start \
-H "Content-Type: application/json" \
-d '{"localPath": "/Downloads/MediaGo", "deleteSegments": true}'
# Stop a task
curl -X POST http://localhost:39719/api/downloads/123/stop
# Get logs
curl http://localhost:39719/api/downloads/123/logs
```
## Download events
`GET /api/events` is a Server-Sent Events stream. Download-related events:
| Event | Payload | Notes |
| ------------------ | -------------------------------- | ------------------------- |
| `download-create` | `{ids: number[], count: number}` | Bulk task creation |
| `download-start` | `{id: string}` | Download started |
| `download-success` | `{id: string}` | Download completed |
| `download-failed` | `{id: string, error: string}` | Download failed |
| `download-stop` | `{id: string}` | Download manually stopped |
## Endpoint reference
### List / query
#### `GET /api/downloads` — paginated list
**Query params:**
- `current` (number, default 1) — page number
- `pageSize` (number, default 20) — page size
- `filter` (string, optional) — status filter (`downloading` / `success` / `failed`)
- `localPath` (string, optional) — save-path filter
**Response:**
```json
{
"total": 42,
"list": [
/* DownloadTask[] */
]
}
```
#### `GET /api/downloads/active` — list active tasks
Returns all tasks in `waiting` or `downloading` state.
#### `GET /api/downloads/:id` — get one task
**Response** (`DownloadTask` shape):
```json
{
"id": 123,
"name": "My Video",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"folder": "my-folder",
"headers": "User-Agent: ...",
"isLive": false,
"status": "success",
"file": "/path/to/saved.mp4",
"createdDate": "2026-04-23T10:00:00Z",
"updatedDate": "2026-04-23T10:05:30Z"
}
```
#### `GET /api/downloads/folders` — list unique save directories
**Response:** `string[]`
#### `GET /api/downloads/export` — export URL list
Plain text, one URL per line.
#### `GET /api/downloads/:id/logs` — fetch download logs
**Response:** `{ id, log: string }`
### Create / delete
#### `POST /api/downloads` — batch create downloads
**Body:**
```json
{
"tasks": [
{
"type": "m3u8 | bilibili | direct | youtube | mediago",
"url": "https://example.com/video.m3u8",
"name": "Task name",
"folder": "optional subdir",
"headers": "optional multi-line HTTP headers"
}
],
"startDownload": true
}
```
**Response:** `DownloadTask[]`
#### `DELETE /api/downloads/:id` — delete task
**Response:** `{}`
### Edit / status
#### `PUT /api/downloads/:id` — edit task
**Body** (all fields optional):
```json
{
"name": "New name",
"url": "New URL",
"headers": "New headers",
"folder": "New subdir"
}
```
#### `PUT /api/downloads/:id/live` — toggle live-stream flag
**Body:** `{ "isLive": true }`
#### `PUT /api/downloads/status` — bulk status update
**Body:** `{ "ids": number[], "status": "waiting | downloading | success | failed | stopped" }`
### Start / stop
#### `POST /api/downloads/:id/start` — start download
**Body:**
```json
{
"localPath": "/Users/me/Downloads/MediaGo",
"deleteSegments": true
}
```
- `localPath`: where to save (absolute path)
- `deleteSegments`: for m3u8 downloads, whether to delete segment `.ts` files after merging
#### `POST /api/downloads/:id/stop` — stop download
**Response:** `{}`
## Enum values
### Download type `type`
| Value | Notes |
| ---------- | ------------------------------------------ |
| `m3u8` | HLS streams (backed by N_m3u8DL-RE) |
| `bilibili` | Bilibili videos (backed by BBDown) |
| `direct` | Direct HTTP download (backed by aria2) |
| `youtube` | YouTube and 1000+ sites (backed by yt-dlp) |
| `mediago` | MediaGo internal type |
### Task status `status`
| Value | Notes |
| ------------- | ------------------- |
| `waiting` | Queued, not started |
| `downloading` | In progress |
| `success` | Completed |
| `failed` | Errored out |
| `stopped` | Manually stopped |
+8 -6
View File
@@ -7,18 +7,20 @@ outline: deep
This article provides a simple guide to help you get started with using the software. Supports [OpenClaw Skill](/en/skills) for downloading videos via natural language in AI coding assistants.
::: tip
To facilitate communication and feedback, you can join the feedback group:
MediaGo QQ Feedback Group 1: 574209001
:::
::: info
v3.5 is the latest version. Please feel free to provide feedback in this release and we will address it as quickly as possible.
:::
::: tip
macOS usage
- **[Intel chip]** Install the x64 build from the release page. After installation, allow apps from unidentified developers in Mac's Security settings.
- **[Apple Silicon]** Install the arm64 build from the release page. After installation, run `sudo xattr -dr com.apple.quarantine /Applications/mediago-community.app` in Terminal.
:::
## Download and Installation
### v3.5.0 (Released on April 22, 2026)
+30 -18
View File
@@ -3,34 +3,46 @@
layout: home
hero:
name: "Online Video Downloader"
text: "Simple and Easy, Fast Downloading"
tagline: Simple to learn, no need for packet capture, no plugins required
name: "MediaGo"
text: "Cross-platform video downloader"
tagline: "Built-in sniffing — point it at a page, pick what you want, save. No packet capture, no plugins, no command-line tools."
image:
src: /home.png
alt: home
src: /home_en.png
alt: MediaGo home screen
actions:
- theme: brand
text: Quick Start
link: /guides
link: /en/guides
- theme: alt
text: User Guide
link: /documents
link: /en/documents
features:
- icon: ⏩
title: No Packet Capture Required
details: Use the built-in browser of the software to easily sniff video resources on web pages. Select the resource you want to download from the sniffed resource list—simple and fast.
- icon: 📱
title: Mobile Playback
details: Seamlessly switch between PC and mobile devices. After the download is complete, you can watch the video on your phone.
title: No packet capture required
details: The desktop app ships with a built-in browser that sniffs every downloadable resource on the page automatically. No Fiddler, no Charles, no DevTools gymnastics.
- icon: 🌐
title: Browser extension for Chrome / Edge
details: One-click video sniffing in your everyday browser. Detected count shows in the toolbar badge; covers YouTube, Bilibili and most mainstream video platforms. Bundled with the desktop app.
- icon: 🎬
title: Broad video source coverage
details: HLS / m3u8 streams, live streaming, Bilibili, YouTube, Twitter/X, Instagram and over a thousand more video sites — powered by N_m3u8DL-RE, BBDown and yt-dlp under the hood.
- icon: ⚡️
title: Batch Download Supported
details: Supports downloading multiple videos and live streaming resources at the same time, ensuring that your high-speed bandwidth is fully utilized.
- icon: 🎉
title: Docker Deployment Supported
details: Supports Docker deployment for the web version, making it quick and easy.
title: Batch download
details: Download multiple videos and live streams at once. Your high-speed bandwidth never sits idle; tweak the concurrency to taste.
- icon: 🎞️
title: Built-in format conversion
details: Convert completed downloads to another format or quality without leaving MediaGo. No separate ffmpeg tool required.
- icon: 📱
title: Mobile playback
details: The desktop app listens on your LAN IP too — open the web UI on a phone or tablet on the same Wi-Fi to browse downloads and play them directly.
- icon: 🔌
title: Open HTTP API
details: Full HTTP API lets scripts, automation tools and third-party apps create download tasks, query progress and manage the list.
- icon: 🦞
title: OpenClaw Skill
details: Download videos using natural language in AI coding assistants (OpenClaw, Claude Code, etc.). Install with one command.
details: Tell Claude Code, Cursor or your AI coding assistant "please download this video" — it handles the rest. One command to install.
- icon: 🐳
title: One-line Docker deployment
details: One command to deploy to your NAS or VPS. Access from any browser on your network. Multi-arch images on Docker Hub and GHCR.
---
+25 -13
View File
@@ -3,12 +3,12 @@
layout: home
hero:
name: "在线视频下载"
text: "简单易用,快速下载"
tagline: 简单易学,无需抓包,不需要安装插件
name: "MediaGo"
text: "跨平台视频下载"
tagline: "内置嗅探,打开网页、选一下想要的资源、保存完事。不用抓包,不用折腾浏览器插件,不用碰命令行。"
image:
src: /home.png
alt: home
alt: MediaGo 首页
actions:
- theme: brand
text: 快速开始
@@ -20,17 +20,29 @@ hero:
features:
- icon: ⏩
title: 无需抓包
details: 使用软件自带浏览器可以轻松嗅探网页中的视频资源,通过嗅探到的资源列表选择自己想要下载的资源,简单快速
- icon: 📱
title: 移动播放
details: 可以轻松无缝的在PC和移动设备之前切换,下载完成后即可使用手机观看视频
details: 桌面端内置浏览器,打开视频页就自动嗅探出所有可下载的资源,不用 Fiddler、Charles 之类的抓包工具
- icon: 🌐
title: 浏览器扩展(Chrome / Edge
details: 日常用的 Chrome / Edge 里也能一键嗅探视频,检测到的数量显示在工具栏图标上。随桌面端一起打包
- icon: 🎬
title: 多种视频源一锅端
details: HLS / m3u8 流媒体、直播推流、Bilibili、YouTube、Twitter/X、Instagram 等一千多个视频站点,底层集成 N_m3u8DL-RE、BBDown、yt-dlp 等专业下载工具。
- icon: ⚡️
title: 支持批量下载
details: 支持同时下载多个视频和直播资源,高速带宽不闲置。
- icon: 🎉
title: 支持 docker 部署
details: 支持 docker 部署 web 端,方便快捷
details: 同时下载多个视频和直播资源,高速带宽不闲置,队列并发全由你调
- icon: 🎞️
title: 内置格式转换
details: 下载完成后直接在 MediaGo 里转换格式、选画质,不用再打开别的工具
- icon: 📱
title: 移动播放
details: 桌面端同时监听局域网 IP,同一 Wi-Fi 下的手机、平板打开浏览器就能访问下载列表并直接播放。
- icon: 🔌
title: 开放 HTTP 接口
details: 提供完整的 HTTP API,脚本、自动化工具、第三方应用都能创建任务、查询进度、管理下载列表。
- icon: 🦞
title: OpenClaw Skill
details: 支持通过 AI 编程助手(OpenClaw、Claude Code 等)用自然语言下载视频,一键安装即可使用
details: 在 Claude Code、Cursor 等 AI 编程助手中直接说"帮我下这个视频"即可,剩下的交给 AI。一条命令安装 Skill
- icon: 🐳
title: Docker 一键部署
details: 一条命令部署到 NAS / VPS 上,浏览器直接访问。Docker Hub 和 GHCR 同步发布多架构镜像。
---
+302
View File
@@ -0,0 +1,302 @@
---
layout: doc
outline: deep
---
# ダウンロード API
MediaGo はダウンロードエンジンを HTTP サービスとして公開しています。デスクトップ版はポート `39719` で、Docker デプロイメントはポート `9900` でリッスンします。
HTTP をしゃべれるツール(curl / Python / Node.js / Postman など)なら何でも、この API を直接呼び出してダウンロードタスクの作成、開始、停止、進捗の取得ができます —— MediaGo 自身のブラウザ拡張機能や AI Skill もこの API の利用者です。
## 基本情報
### ベース URL
| デプロイメント | Base URL |
| -------------- | ---------------------------------------------------------------------------- |
| デスクトップ版 | `http://localhost:39719` |
| Docker | `http://<サーバーアドレス>:9900`(実際の `-p` ポートマッピングに合わせて調整) |
すべてのエンドポイントは `/api` プレフィックスの下にあります。以下の例はデスクトップ版のポート `39719` を使っています。Docker 構成の場合はそちらのポートに置き換えてください。
### レスポンス形式
すべての `/api/*` エンドポイントは統一された JSON ラッパー構造を返します:
```json
{
"success": true,
"code": 0,
"message": "ok",
"data": { ... }
}
```
| フィールド | 型 | 説明 |
| ---------- | ------ | ------------------------------------------------------------ |
| `success` | bool | ビジネス処理が成功したかどうか |
| `code` | number | ビジネスエラーコード。`0` は成功 |
| `message` | string | 人間が読めるメッセージ |
| `data` | any | 実際のレスポンスペイロード。エンドポイントにより構造が異なる |
以下の例の「レスポンス」では `data` フィールドの内容のみを示します。
### 認証
- **デスクトップ版**:デフォルトで**認証不要**、`localhost:39719` に直接リクエストするだけ
- **Docker デプロイメント**:認証を有効にした場合、MediaGo の**設定ページ**から API キーを取得し、以降のリクエストに `Authorization: Bearer <key>` ヘッダーを付与します
## クイックスタート
以下の 3 つの curl コマンドで「作成 → ダウンロード開始 → 完了通知」のフローが一通り流れます。
### 1. ダウンロードタスクの作成
```bash
curl -X POST http://localhost:39719/api/downloads \
-H "Content-Type: application/json" \
-d '{
"tasks": [
{
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"name": "私の動画"
}
],
"startDownload": true
}'
```
- `type`:ダウンロードタイプ。`m3u8` / `bilibili` / `direct` / `youtube` / `mediago` から選択
- `url`:動画の URL
- `name`:タスク名(保存ファイル名として使われる)
- `startDownload`:作成後すぐにダウンロードを開始するかどうか
レスポンス:
```json
[
{
"id": 123,
"name": "私の動画",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"status": "waiting",
"createdDate": "2026-04-23T10:00:00Z"
}
]
```
返ってきた `id` を控えておいてください。以降のエンドポイントで使います。
### 2. ダウンロードイベントの購読(SSE)
```bash
curl -N http://localhost:39719/api/events
```
これは長時間接続です。サーバーがプッシュした内容がそのまま流れてきます:
```text
event: download-start
data: {"id": "123"}
event: download-success
data: {"id": "123"}
```
ブラウザ / Node.js の場合:
```javascript
const es = new EventSource("http://localhost:39719/api/events");
es.addEventListener("download-success", (e) => {
const { id } = JSON.parse(e.data);
console.log("タスク完了:", id);
});
```
### 3. 状態の照会 / 手動制御
```bash
# すべてのダウンロードタスクを一覧表示(ページング)
curl "http://localhost:39719/api/downloads?current=1&pageSize=20"
# 単一のタスクを取得
curl http://localhost:39719/api/downloads/123
# 既存のタスクを開始
curl -X POST http://localhost:39719/api/downloads/123/start \
-H "Content-Type: application/json" \
-d '{"localPath": "/Downloads/MediaGo", "deleteSegments": true}'
# タスクを停止
curl -X POST http://localhost:39719/api/downloads/123/stop
# ログを取得
curl http://localhost:39719/api/downloads/123/logs
```
## ダウンロードイベント
`GET /api/events` は Server-Sent Events ストリームです。ダウンロード関連のイベント:
| イベント名 | ペイロード | 説明 |
| ------------------ | -------------------------------- | ---------------------- |
| `download-create` | `{ids: number[], count: number}` | タスクの一括作成 |
| `download-start` | `{id: string}` | ダウンロード開始 |
| `download-success` | `{id: string}` | ダウンロード成功 |
| `download-failed` | `{id: string, error: string}` | ダウンロード失敗 |
| `download-stop` | `{id: string}` | ダウンロードを手動停止 |
## エンドポイントリファレンス
### 一覧 / 照会
#### `GET /api/downloads` — ページング付きの一覧取得
**クエリパラメータ:**
- `current` (number, デフォルト 1):ページ番号
- `pageSize` (number, デフォルト 20):ページサイズ
- `filter` (string, 任意):ステータスでフィルタ(`downloading` / `success` / `failed`)
- `localPath` (string, 任意):保存パスでフィルタ
**レスポンス:**
```json
{
"total": 42,
"list": [
/* DownloadTask[] */
]
}
```
#### `GET /api/downloads/active` — アクティブなタスクの一覧
`waiting` / `downloading` 状態のタスクをすべて返します。
#### `GET /api/downloads/:id` — 単一タスクの取得
**レスポンス**(`DownloadTask` 構造):
```json
{
"id": 123,
"name": "私の動画",
"type": "m3u8",
"url": "https://example.com/video.m3u8",
"folder": "my-folder",
"headers": "User-Agent: ...",
"isLive": false,
"status": "success",
"file": "/path/to/saved.mp4",
"createdDate": "2026-04-23T10:00:00Z",
"updatedDate": "2026-04-23T10:05:30Z"
}
```
#### `GET /api/downloads/folders` — 重複なしの保存ディレクトリ一覧
**レスポンス:** `string[]`
#### `GET /api/downloads/export` — ダウンロードリストのエクスポート
プレーンテキスト、1 行 1 URL。
#### `GET /api/downloads/:id/logs` — ダウンロードログの取得
**レスポンス:** `{ id, log: string }`
### 作成 / 削除
#### `POST /api/downloads` — ダウンロードの一括作成
**リクエストボディ:**
```json
{
"tasks": [
{
"type": "m3u8 | bilibili | direct | youtube | mediago",
"url": "https://example.com/video.m3u8",
"name": "タスク名",
"folder": "任意のサブディレクトリ",
"headers": "任意、複数行の HTTP ヘッダー"
}
],
"startDownload": true
}
```
**レスポンス:** `DownloadTask[]`
#### `DELETE /api/downloads/:id` — タスクの削除
**レスポンス:** `{}`
### 編集 / ステータス
#### `PUT /api/downloads/:id` — タスクの編集
**リクエストボディ**(すべて任意):
```json
{
"name": "新しい名前",
"url": "新しい URL",
"headers": "新しいヘッダー",
"folder": "新しいサブディレクトリ"
}
```
#### `PUT /api/downloads/:id/live` — ライブ配信フラグの切り替え
**リクエストボディ:** `{ "isLive": true }`
#### `PUT /api/downloads/status` — ステータスの一括更新
**リクエストボディ:** `{ "ids": number[], "status": "waiting | downloading | success | failed | stopped" }`
### 開始 / 停止
#### `POST /api/downloads/:id/start` — ダウンロード開始
**リクエストボディ:**
```json
{
"localPath": "/Users/me/Downloads/MediaGo",
"deleteSegments": true
}
```
- `localPath`:保存先(絶対パス)
- `deleteSegments`:m3u8 ダウンロード完了後、分割された `.ts` ファイルを削除するかどうか
#### `POST /api/downloads/:id/stop` — ダウンロード停止
**レスポンス:** `{}`
## 列挙値
### ダウンロードタイプ `type`
| 値 | 説明 |
| ---------- | ------------------------------------------------- |
| `m3u8` | HLS ストリーム(内部では N_m3u8DL-RE を使用) |
| `bilibili` | Bilibili 動画(内部では BBDown を使用) |
| `direct` | 直接 HTTP ダウンロード(内部では aria2 を使用) |
| `youtube` | YouTube および yt-dlp がサポートする 1000+ サイト |
| `mediago` | MediaGo 内部タイプ |
### タスク状態 `status`
| 値 | 説明 |
| ------------- | -------------------- |
| `waiting` | キューに入り、未開始 |
| `downloading` | ダウンロード中 |
| `success` | 完了 |
| `failed` | 失敗 |
| `stopped` | 手動停止 |
+8 -7
View File
@@ -7,17 +7,18 @@ outline: deep
この記事では、ソフトウェアの簡単な説明を行い、すぐに使用できるようにします。[OpenClaw Skill](/jp/skills) に対応し、AI アシスタントで自然言語を使って動画をダウンロードできます。
::: tip
皆さんがより便利にコミュニケーションできるよう、フィードバックグループに参加できます:
MediaGo QQフィードバックグループ 1 574209001
:::
::: info
v3.5 が最新バージョンです。ご意見はできるだけこのバージョンでお寄せください。できるだけ早く対応します。
:::
::: tip
macOS での使用
- **【Intel チップ】** Release から x64 版をインストールしてください。インストール後、Mac のセキュリティ設定で「身元不明の開発元からの App」を許可する必要があります。
- **【Apple チップ】** Release から arm64 版をインストールしてください。インストール後、ターミナルで `sudo xattr -dr com.apple.quarantine /Applications/mediago-community.app` を実行する必要があります。
:::
## ダウンロードとインストール
### v3.5.0 (2026年4月22日リリース)
+27 -15
View File
@@ -2,34 +2,46 @@
layout: home
hero:
name: "オンライン動画ダウンロード"
text: "簡単に使えて、素早くダウンロー"
tagline: 簡単に学べ、パケットキャプチャ不要、プラグインのインストールも不要
name: "MediaGo"
text: "クロスプラットフォーム動画ダウンローダー"
tagline: "ビルトインのスニッフィング — ページを開いて、欲しいリソースを選んで、保存するだけ。パケットキャプチャ不要、プラグイン不要、コマンドライン不要。"
image:
src: /home.png
alt: home
alt: MediaGo ホーム画面
actions:
- theme: brand
text: すぐに開始
link: /guides
link: /jp/guides
- theme: alt
text: 使用説明
link: /documents
link: /jp/documents
features:
- icon: ⏩
title: パケットキャプチャ不要
details: ソフトウェア内蔵ブラウザを使用して、ウェブページの動画リソースを簡単にスニッフし、スニッフしたリソースのリストからダウンロードしたいリソースを選択できます。シンプルで高速です。
- icon: 📱
title: モバイル再生
details: PCとモバイルデバイス間でシームレスに切り替えができ、ダウンロードが完了するとすぐにスマホで動画を視聴できます
details: デスクトップ版に内蔵ブラウザを搭載、動画ページを開くだけでダウンロード可能なリソースを自動で検出します。Fiddler や Charles などのパケットキャプチャツールは不要です。
- icon: 🌐
title: ブラウザ拡張機能(Chrome / Edge
details: 普段使いの Chrome / Edge でワンクリック動画スニッフィング。ツールバーアイコンに検出件数を表示し、YouTube、Bilibili など主要な動画サイトに対応。デスクトップ版に同梱
- icon: 🎬
title: 幅広い動画ソースに対応
details: HLS / m3u8 ストリーム、ライブ配信、Bilibili、YouTube、Twitter/X、Instagram など 1000 以上の動画サイトに対応。内部では N_m3u8DL-RE、BBDown、yt-dlp を使用しています。
- icon: ⚡️
title: バッチダウンロード対応
details: 複数の動画やライブストリーミングリソースを同時にダウンロードでき、高速な帯域幅無駄に使われることはありません
- icon: 🎉
title: Dockerデプロイ対応
details: Web端をDockerでデプロイでき、簡単で迅速に設定できます
details: 複数の動画やライブストリーミングを同時にダウンロード高速な帯域幅無駄にせず、同時実行数もお好みで調整できます
- icon: 🎞️
title: 内蔵フォーマット変換
details: ダウンロード完了後、MediaGo 内で他のフォーマットや画質に変換できます。ffmpeg を別途起動する必要はありません
- icon: 📱
title: モバイル再生
details: デスクトップ版は LAN IP でも待ち受けるため、同じ Wi-Fi のスマートフォンやタブレットから Web UI を開いてダウンロード一覧を参照し、直接再生できます。
- icon: 🔌
title: 開放 HTTP API
details: 完全な HTTP API を提供し、スクリプト、自動化ツール、サードパーティアプリからダウンロードタスクの作成、進捗の取得、リスト管理が可能です。
- icon: 🦞
title: OpenClaw Skill
details: AI コーディングアシスタント(OpenClaw、Claude Code など)で自然言語を使って動画をダウンロード。ワンコマンドでインストール。
details: Claude Code や Cursor などの AI コーディングアシスタントに「この動画をダウンロードして」と伝えるだけで OK。ワンコマンドで Skill をインストール。
- icon: 🐳
title: Docker ワンライン展開
details: 1 コマンドで NAS / VPS にデプロイ、同じネットワーク内のブラウザから直接アクセス。Docker Hub と GHCR のマルチアーキテクチャイメージ対応。
---
Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB