Environment:869413421 Ai moive studio biliup CLI
| Knowledge Sources | |
|---|---|
| Domains | Distribution, Infrastructure |
| Last Updated | 2026-10-23 14:00 GMT |
Overview
biliup (biliup-rs) CLI binary required for uploading videos to Bilibili with cookie-based authentication.
Description
This environment requires the biliup executable to be placed at `./bin/biliup` (Linux/macOS) or `./bin/biliup.exe` (Windows). The binary is a Rust-based CLI tool that handles Bilibili authentication via QR-code login (producing a cookie JSON file) and video uploads with metadata (title, description, tags, cover, category). The backend invokes biliup via asyncio.create_subprocess_exec and parses BV/AV numbers from stdout.
Usage
Use this environment for Content Distribution workflows that publish generated videos to Bilibili. It is the mandatory prerequisite for running the BilibiliService_upload_video and BilibiliService_get_login_command implementations.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux / macOS / Windows | Platform-dependent binary path |
| Hardware | CPU | No GPU required |
| Disk | 1GB | Temporary video downloads before upload |
| Network | Internet access | Must reach bilibili.com APIs |
Dependencies
System Packages
- `biliup` (biliup-rs binary) at `./bin/biliup` or `./bin/biliup.exe`
Python Packages
- No Python packages — biliup is invoked via subprocess
Credentials
The following are required at runtime:
- Bilibili cookie file: JSON file at `./data/bilibili_cookies/{account_id}.json` containing `token_info.access_token` and `cookie_info.cookies`. Generated via `biliup login` QR-code flow.
- No environment variables — authentication is file-based.
Quick Install
# Download biliup-rs from GitHub releases
# https://github.com/biliup/biliup-rs/releases
mkdir -p ./bin
# Linux example:
wget -O ./bin/biliup https://github.com/biliup/biliup-rs/releases/latest/download/biliup-linux
chmod +x ./bin/biliup
# Verify
./bin/biliup --version
# Login (interactive QR code)
./bin/biliup login
# Then move cookie: mv cookies.json ./data/bilibili_cookies/{account_id}.json
Code Evidence
Platform-dependent binary path from `bilibili.py:33-38`:
def _get_biliup_path(self) -> str:
import platform
if platform.system() == "Windows":
return str(Path("./bin/biliup.exe").absolute())
return str(Path("./bin/biliup").absolute())
Upload command construction from `bilibili.py:195-214`:
cmd = [self.biliup_path]
if cookie_file:
abs_cookie_path = str(Path(cookie_file).resolve())
cmd.extend(["-u", abs_cookie_path])
cmd.extend(["upload", video_path])
cmd.extend([
"--title", title, "--desc", desc,
"--tid", str(tid), "--copyright", str(copyright),
"--line", line, "--limit", str(limit)
])
Cookie validation from `bilibili.py:82-95`:
with open(cookie_path, 'r', encoding='utf-8') as f:
cookie_data = json.load(f)
has_token = bool(
cookie_data.get('token_info', {}).get('access_token') or
cookie_data.get('cookie_info', {}).get('cookies') or
cookie_data.get('access_token') or
cookie_data.get('cookies')
)
return has_token
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `未找到B站登录凭证` | Cookie file missing or invalid | Run `biliup login` and move cookie to `./data/bilibili_cookies/` |
| Upload returns non-zero exit | Cookie expired or network issue | Re-login via `biliup login` to refresh cookie |
| `No such file: ./bin/biliup` | Binary not installed | Download biliup-rs and place at `./bin/biliup` |
Compatibility Notes
- Windows: Uses `biliup.exe` extension; Linux/macOS use `biliup` without extension.
- Cookie format: biliup-rs produces a JSON file with `token_info.access_token` and `cookie_info.cookies` fields. The backend validates both formats.
- Upload line: Default line is `bda2`; configurable via publish task settings.
- Concurrency: Default upload concurrency limit is 3 (`--limit 3`).