关于 biliup
用于安装和操作 biliup 命令行工具的技能,指导用户完成设置,以及录制、视频上传与下载、账号登录和合集管理等操作。
主要功能
- 01指导安装预编译包或 npm 包
- 02启动 WebUI 服务
- 03根据配置文件运行录制任务
- 04登录并管理 Cookie
- 05上传、追加和下载视频
- 06管理视频合集
适用场景
- 01安装 biliup 并验证命令行工具
- 02启动带身份验证的 WebUI 服务
- 03根据配置文件运行录制任务
- 04管理已投稿视频和合集
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ biliup/ biliup --skill biliup安装后在 Claude Code 中输入/biliup确认已加载。
详细介绍
biliup
当用户想要安装或使用 biliup 命令行工具时,使用此技能。
biliup 可以启动 WebUI 服务器、根据配置文件运行录制任务、登录、上传视频、追加视频、查看视频信息、下载视频、列出已上传的视频,以及管理用户的合集。
安装流程
当用户需要安装 biliup 时,根据用户的操作系统和偏好选择一种安装方式。
GitHub Releases 预编译包
当用户想要从 GitHub Releases 安装预编译二进制文件时,使用此方式。
对于 Linux 或 macOS,生成并运行此脚本。必要时,将 INSTALL_DIR 设置为用户指定的目录。
set -euo pipefail
REPO="biliup/biliup"
INSTALL_DIR="${INSTALL_DIR:-$HOME/.local/bin}"
OS="$(uname -s)"
ARCH="$(uname -m)"
case "$OS" in
Linux) os="linux" ;;
Darwin) os="macos" ;;
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
esac
case "$ARCH" in
x86_64|amd64) arch="x86_64" ;;
aarch64|arm64) arch="aarch64" ;;
armv7l|armv7*) arch="arm" ;;
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
esac
asset="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest" \
| python3 -c 'import json,sys; data=json.load(sys.stdin); os=sys.argv[1]; arch=sys.argv[2]; assets=[a["name"] for a in data["assets"]]; matches=[n for n in assets if n.endswith(".tar.xz") and f"-{arch}-{os}.tar.xz" in n]; print(matches[0] if matches else "")' "$os" "$arch")"
if [ -z "$asset" ]; then
echo "No matching biliup release asset for ${arch}-${os}" >&2
exit 1
fi
url="https://github.com/${REPO}/releases/latest/download/${asset}"
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
curl -fL "$url" -o "$tmp/$asset"
tar -xJf "$tmp/$asset" -C "$tmp"
mkdir -p "$INSTALL_DIR"
install -m 755 "$(find "$tmp" -type f -name biliup | head -n 1)" "$INSTALL_DIR/biliup"
"$INSTALL_DIR/biliup" --help
对于 Windows PowerShell,生成并运行此脚本。必要时,将 $InstallDir 设置为用户指定的目录。
$ErrorActionPreference = "Stop"
$Repo = "biliup/biliup"
$InstallDir = if ($env:INSTALL_DIR) { $env:INSTALL_DIR } else { Join-Path $env:USERPROFILE "bin" }
$Arch = if ([Environment]::Is64BitOperatingSystem) { "x86_64" } else { throw "Unsupported Windows architecture" }
$Release = Invoke-RestMethod "https://api.github.com/repos/$Repo/releases/latest"
$Asset = $Release.assets | Where-Object { $_.name -like "biliupR-v*-$Arch-windows.zip" } | Select-Object -First 1
if (-not $Asset) { throw "No matching biliup release asset for $Arch-windows" }
$Tmp = New-Item -ItemType Directory -Force (Join-Path ([IO.Path]::GetTempPath()) ([Guid]::NewGuid().ToString()))
try {
$Zip = Join-Path $Tmp.FullName $Asset.name
Invoke-WebRequest $Asset.browser_download_url -OutFile $Zip
Expand-Archive $Zip -DestinationPath $Tmp.FullName -Force
New-Item -ItemType Directory -Force $InstallDir | Out-Null
$Exe = Get-ChildItem $Tmp.FullName -Recurse -Filter biliup.exe | Select-Object -First 1
if (-not $Exe) { throw "biliup.exe not found in release archive" }
Copy-Item $Exe.FullName (Join-Path $InstallDir "biliup.exe") -Force
& (Join-Path $InstallDir "biliup.exe") --help
} finally {
Remove-Item $Tmp.FullName -Recurse -Force
}
如果目标目录不在 PATH 中,请告知用户通过完整路径运行 biliup,或将目标目录添加到 PATH 中。
npm
当用户可以使用 Node.js(npm)时,使用此方式:
npm i -g @biliup/cli
然后验证:
biliup --help
操作流程
当用户要求启动带身份验证的 WebUI 服务器时,使用:
biliup server --auth
当用户提供地址或端口时,请明确包含它们:
biliup server --bind 0.0.0.0 --port 19159 --auth
当用户要求使用 biliup 1.0.7 风格的配置文件运行时,使用:
biliup server --config config.toml
将 config.toml 替换为用户的配置文件路径。
当用户想要在 Linux 或 macOS 上于后台运行服务器时,使用:
nohup biliup server --auth &
当用户要求管理合集时,使用 season 子命令。它们会从 Cookie 文件读取登录信息(-u/--user-cookie,默认为 cookies.json),因此如果该文件不存在,请先运行 biliup login。添加 --json 可输出机器可读内容。
biliup season list
biliup season sections <season_id>
biliup season add <section_id> --vid <BV or av>
biliup season remove <episode_id>
biliup season sort <section_id> <episode_id>...
list 会显示合集和分区 ID;sections 会显示每个剧集的 episode_id(而非 aid),remove 和 sort 使用此 ID。add 会自动查询 cid 和标题,并且可多次使用 --vid。sort 会按给定顺序将列出的剧集移到最前面,并保持其余剧集当前的顺序;--reverse 则会反转整个分区。
帮助流程
当用户询问有哪些可用命令时,显示:
biliup --help
当用户询问服务器选项时,显示:
biliup server --help
当用户询问特定命令时,使用:
biliup <command> --help
将 <command> 替换为用户指定的子命令。
命令
CLI 包含以下子命令:
login
renew
upload
append
show
comments
reply
dump-flv
download
server
season
user
list
生成命令时,请包含该命令所需的具体路径,例如 Cookie 文件、配置文件和视频文件路径。