moviepilot-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMoviePilot System Update & Restart
MoviePilot 系统更新与重启
All script paths are relative to this skill file.
This skill provides capabilities to restart MoviePilot service, check for updates, and perform manual upgrades.
所有脚本路径均相对于此技能文件。
本技能提供重启MoviePilot服务、检查更新、执行手动升级的能力。
Restart MoviePilot
重启MoviePilot
Method 1: Using REST API (Recommended)
方法1:使用REST API(推荐)
Call the restart endpoint with admin authentication:
bash
undefined使用管理员身份认证调用重启接口:
bash
undefinedUsing moviepilot-api skill
Using moviepilot-api skill
python scripts/mp-api.py GET /api/v1/system/restart
Or with curl:
```bash
curl -X GET "http://localhost:3000/api/v1/system/restart" \
-H "X-API-KEY: <YOUR_API_TOKEN>"Note: This API will restart the Docker container internally. The service will be briefly unavailable during restart.
python scripts/mp-api.py GET /api/v1/system/restart
或者使用curl:
```bash
curl -X GET "http://localhost:3000/api/v1/system/restart" \
-H "X-API-KEY: <YOUR_API_TOKEN>"注意: 该API会在内部重启Docker容器,重启期间服务会短暂不可用。
Method 2: Using execute_command tool
方法2:使用execute_command工具
If you have admin privileges, you can execute the restart command directly:
bash
docker restart moviepilot如果你拥有管理员权限,可以直接执行重启命令:
bash
docker restart moviepilotCheck for Updates
检查更新
Method 1: Using REST API
方法1:使用REST API
bash
python scripts/mp-api.py GET /api/v1/system/versionsThis returns all available GitHub releases.
bash
python scripts/mp-api.py GET /api/v1/system/versions该接口会返回所有可用的GitHub版本。
Method 2: Check current version
方法2:查看当前版本
bash
undefinedbash
undefinedCheck current version
Check current version
cat /app/version.py
undefinedcat /app/version.py
undefinedUpgrade MoviePilot
升级MoviePilot
Option 1: Automatic Update (Recommended)
选项1:自动更新(推荐)
Set the environment variable and restart:
MOVIEPILOT_AUTO_UPDATE-
For Docker Compose users:bash
# Edit docker-compose.yml, add environment variable: environment: - MOVIEPILOT_AUTO_UPDATE=release # or "dev" for dev版本 # Then restart docker-compose down && docker-compose up -d -
For Docker run users:bash
docker stop moviepilot docker rm moviepilot docker run -d ... -e MOVIEPILOT_AUTO_UPDATE=release jxxghp/moviepilot
The update script ( or ) will automatically:
/usr/local/bin/mp_update.sh/app/docker/update.sh- Check GitHub for latest release
- Download new backend code
- Update dependencies if changed
- Download new frontend
- Update site resources
- Restart the service
设置环境变量后重启服务:
MOVIEPILOT_AUTO_UPDATE-
Docker Compose用户:bash
# Edit docker-compose.yml, add environment variable: environment: - MOVIEPILOT_AUTO_UPDATE=release # or "dev" for dev版本 # Then restart docker-compose down && docker-compose up -d -
Docker run用户:bash
docker stop moviepilot docker rm moviepilot docker run -d ... -e MOVIEPILOT_AUTO_UPDATE=release jxxghp/moviepilot
更新脚本( 或 )会自动执行以下操作:
/usr/local/bin/mp_update.sh/app/docker/update.sh- 检查GitHub上的最新发行版
- 下载新的后端代码
- 若依赖有变更则更新依赖
- 下载新的前端资源
- 更新站点资源
- 重启服务
Option 2: Manual Upgrade
选项2:手动升级
If you need to manually download and apply updates:
-
Get latest release version:bash
curl -s https://api.github.com/repos/jxxghp/MoviePilot/releases | grep '"tag_name"' | grep "v2" | head -1 -
Download and extract backend:bash
# Replace v2.x.x with actual version curl -L -o /tmp/backend.zip https://github.com/jxxghp/MoviePilot/archive/refs/tags/v2.x.x.zip unzip -d /tmp/backend /tmp/backend.zip -
Backup and replace:bash
# Backup current installation cp -r /app /app_backup # Replace files (exclude config and plugins) cp -r /tmp/backend/MoviePilot-*/* /app/ -
Restart MoviePilot:bash
# Use API or docker restart python scripts/mp-api.py GET /api/v1/system/restart
如果你需要手动下载并应用更新:
-
获取最新发行版本:bash
curl -s https://api.github.com/repos/jxxghp/MoviePilot/releases | grep '"tag_name"' | grep "v2" | head -1 -
下载并解压后端包:bash
# Replace v2.x.x with actual version curl -L -o /tmp/backend.zip https://github.com/jxxghp/MoviePilot/archive/refs/tags/v2.x.x.zip unzip -d /tmp/backend /tmp/backend.zip -
备份并替换文件:bash
# Backup current installation cp -r /app /app_backup # Replace files (exclude config and plugins) cp -r /tmp/backend/MoviePilot-*/* /app/ -
重启MoviePilot:bash
# Use API or docker restart python scripts/mp-api.py GET /api/v1/system/restart
Important Notes
重要注意事项
- Backup first: Before upgrading, backup your configuration and database
- Dependencies: Check if requirements.in has changes; if so, update virtual environment
- Plugins: The update script automatically backs up and restores plugins
- Non-Docker: For non-Docker installations, use or
git pullpip install -U moviepilot
- 优先备份: 升级前请备份你的配置文件和数据库
- 依赖处理: 检查requirements.in是否有变更,如有则更新虚拟环境
- 插件处理: 更新脚本会自动备份并恢复插件
- 非Docker安装: 非Docker部署的用户可以使用或
git pull升级pip install -U moviepilot
Troubleshooting
故障排查
| Issue | Solution |
|---|---|
| Restart fails | Check if Docker daemon is running; verify container has restart policy |
| Update fails | Check network connectivity to GitHub; ensure sufficient disk space |
| Version unchanged | Verify |
| Dependency errors | May need to rebuild virtual environment: |
| 问题 | 解决方案 |
|---|---|
| 重启失败 | 检查Docker守护进程是否正常运行,确认容器配置了重启策略 |
| 更新失败 | 检查到GitHub的网络连接是否正常,确保磁盘空间充足 |
| 版本未更新 | 确认 |
| 依赖报错 | 可能需要重新构建虚拟环境: |
Environment Variables for Auto-Update
自动更新相关环境变量
| Variable | Value | Description |
|---|---|---|
| | Auto-update to latest stable release |
| | Auto-update to latest dev version |
| | Disable auto-update (default) |
| (token) | GitHub token for higher rate limits |
| (url) | GitHub proxy URL for China users |
| (url) | Global proxy host |
| 变量 | 取值 | 说明 |
|---|---|---|
| | 自动更新到最新稳定版 |
| | 自动更新到最新开发版 |
| | 关闭自动更新(默认值) |
| (token) | GitHub token,用于提升请求速率上限 |
| (url) | 面向国内用户的GitHub代理地址 |
| (url) | 全局代理地址 |