Download videos from m3u8/HLS streams, Bilibili, and direct URLs using MediaGo. 下载视频、m3u8直播流、B站视频。 Triggers on: download video, 下载视频, 下载这个链接, 帮我下载, m3u8 download, 设置mediago地址, configure mediago, mediago api key. Requires a running MediaGo instance (desktop app or Docker).
Download videos from m3u8/HLS streams, Bilibili, and direct URLs via a running MediaGo instance.
Config file: ~/.mediago-skill.json
{
"url": "http://localhost:8899",
"apiKey": ""
}
If ~/.mediago-skill.json does not exist, show the following message (respond in the user's language):
EN: "MediaGo is not configured yet. To use this skill:
1. Install MediaGo (if you haven't already):
- Desktop app: Download from https://github.com/caorushizi/mediago/releases
docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago ghcr.io/caorushizi/mediago:latest2. Initialize — tell me your MediaGo address, for example:
设置 mediago 地址为 http://localhost:8899设置 mediago 地址为 http://192.168.x.x:39719"CN: "MediaGo 还没有配置。要使用此功能:
1. 安装 MediaGo(如果还没装):
docker run -d --name mediago -p 8899:8899 -v /path/to/mediago:/app/mediago ghcr.io/caorushizi/mediago:latest2. 初始化配置 — 告诉我你的 MediaGo 地址,例如:
设置 mediago 地址为 http://localhost:8899设置 mediago 地址为 http://192.168.x.x:39719"When the user provides the URL (and optionally an API key), write it to ~/.mediago-skill.json.
Trigger on phrases like:
Read the existing config, update the relevant field, and write it back.
All API calls use curl. Read url and apiKey from ~/.mediago-skill.json before each call.
If apiKey is set, add header: -H "X-API-Key: API_KEY"
curl -s BASE_URL/healthy
Returns {"success":true,...} if service is running.
curl -s -X POST BASE_URL/api/downloads \
-H "Content-Type: application/json" \
-d '{"tasks":[{"type":"TYPE","url":"VIDEO_URL","name":"NAME"}],"startDownload":true}'
type (required): m3u8, bilibili, or directurl (required): video URLname (optional): custom filenameType detection from URL:
bilibili.com or b23.tv → bilibili.m3u8 → m3u8directResponse data is an array of created tasks. Extract data[0].id as the task ID.
curl -s BASE_URL/api/downloads/TASK_ID
Response data fields: id, name, status, type, exists, file.
Status values: pending, downloading, success, failed, stopped.
curl -s "BASE_URL/api/downloads?current=1&pageSize=20"
Response: data.total (count) and data.list (array of tasks).
curl -s BASE_URL/api/config
Returns config including local (download directory path).
~/.mediago-skill.json. If missing, run the First-time Setup flow above./api/downloads with startDownload: true./api/downloads/TASK_ID every 3 seconds. Report status to user.success → EN: "Download complete! File: [path]" / CN: "下载完成!文件:[path]"failed → EN: "Download failed." / CN: "下载失败。"name is not provided, omit it from the request — the server will auto-generate one.