moviepilot-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMoviePilot CLI
MoviePilot CLI
All script paths are relative to this skill file.
Use to interact with the MoviePilot backend.
scripts/mp-cli.js所有脚本路径都相对于此技能文件。
使用与MoviePilot后端交互。
scripts/mp-cli.jsDiscover Commands
命令查询
List all available commands:
node scripts/mp-cli.js listShow parameters and usage for a specific command:
node scripts/mp-cli.js show <command>Always run before calling a command — parameter names are not inferable, do not guess.
show <command>列出所有可用命令:
node scripts/mp-cli.js list查看指定命令的参数和用法:
node scripts/mp-cli.js show <command>调用命令前务必先运行——参数名无法推断,请勿猜测。
show <command>Command Groups
命令组
| Category | Commands |
|---|---|
| Media Search | search_media, recognize_media, query_media_detail, get_recommendations, search_person, search_person_credits |
| Torrent | search_torrents, get_search_results |
| Download | add_download, query_download_tasks, delete_download, query_downloaders |
| Subscription | add_subscribe, query_subscribes, update_subscribe, delete_subscribe, search_subscribe, query_subscribe_history, query_popular_subscribes, query_subscribe_shares |
| Library | query_library_exists, query_library_latest, transfer_file, scrape_metadata, query_transfer_history |
| Files | list_directory, query_directory_settings |
| Sites | query_sites, query_site_userdata, test_site, update_site, update_site_cookie |
| System | query_schedulers, run_scheduler, query_workflows, run_workflow, query_rule_groups, query_episode_schedule, send_message |
| 分类 | 命令 |
|---|---|
| 媒体搜索 | search_media, recognize_media, query_media_detail, get_recommendations, search_person, search_person_credits |
| 种子 | search_torrents, get_search_results |
| 下载 | add_download, query_download_tasks, delete_download, query_downloaders |
| 订阅 | add_subscribe, query_subscribes, update_subscribe, delete_subscribe, search_subscribe, query_subscribe_history, query_popular_subscribes, query_subscribe_shares |
| 媒体库 | query_library_exists, query_library_latest, transfer_file, scrape_metadata, query_transfer_history |
| 文件 | list_directory, query_directory_settings |
| 站点 | query_sites, query_site_userdata, test_site, update_site, update_site_cookie |
| 系统 | query_schedulers, run_scheduler, query_workflows, run_workflow, query_rule_groups, query_episode_schedule, send_message |
Workflows
工作流程
Search and Download
搜索与下载
1. Search TMDB
1. 搜索TMDB
Search for a movie or TV show by title:
node scripts/mp-cli.js search_media title="..." media_type="movie"If the user specifies a TV season, run Season Validation step first — the season number provided by the user may not match TMDB.
按标题搜索电影或电视剧:
node scripts/mp-cli.js search_media title="..." media_type="movie"如果用户指定了电视剧季数,请先运行季数验证步骤——用户提供的季数可能与TMDB的季数不匹配。
2. Search torrents
2. 搜索种子
Prefer ; use only when is unavailable.
tmdb_iddouban_idtmdb_idOmitting uses the user's default sites. If the user specifies sites, first retrieve site IDs:
sites=node scripts/mp-cli.js query_sitesSearch torrents using default sites:
node scripts/mp-cli.js search_torrents tmdb_id=791373 media_type="movie"Search torrents using user-specified sites (pass site IDs from ):
query_sitesnode scripts/mp-cli.js search_torrents tmdb_id=791373 media_type="movie" sites='1,3'When returns:
search_torrents- Stop — do not call yet.
get_search_results - Present all fields and every value within each field to the user verbatim.
filter_options - Do not pre-select, summarize, or omit any field or value.
- Wait for the user to select filters or confirm no filters are needed before moving to the next step.
优先使用;仅当不可用时才使用。
tmdb_idtmdb_iddouban_id省略参数时会使用用户的默认站点。如果用户指定了站点,请先获取站点ID:
sites=node scripts/mp-cli.js query_sites使用默认站点搜索种子:
node scripts/mp-cli.js search_torrents tmdb_id=791373 media_type="movie"使用用户指定的站点搜索种子(传入返回的站点ID):
query_sitesnode scripts/mp-cli.js search_torrents tmdb_id=791373 media_type="movie" sites='1,3'当返回结果后:
search_torrents- 暂停——暂时不要调用。
get_search_results - 将所有字段以及每个字段下的所有值原封不动地展示给用户。
filter_options - 不要预选、总结或省略任何字段或值。
- 等待用户选择筛选条件或确认不需要筛选后,再进入下一步。
3. Get filtered results (only after user has responded to filter_options)
3. 获取筛选后的结果(仅在用户对filter_options做出响应后执行)
Run to check available parameters. Filter logic: OR within a field, AND across fields.
node scripts/mp-cli.js show get_search_resultsFilter values must come from the returned by — do not invent, translate, normalize, or use values from any other source. Note: keys are camelCase (e.g., ), but params are snake_case (e.g., ).
filter_optionssearch_torrentsfilter_optionsfreeStateget_search_resultsfree_stateFetch results with selected filters:
node scripts/mp-cli.js get_search_results resolution='1080p,2160p' free_state='免费,50%'If empty, tell the user which filter to relax and ask before retrying.
运行查看可用参数。筛选逻辑:同一字段内的条件为OR关系,不同字段间的条件为AND关系。
node scripts/mp-cli.js show get_search_results筛选值必须来自返回的——不要编造、翻译、标准化或使用任何其他来源的值。注意:的键是驼峰命名(例如),但的参数是蛇形命名(例如)。
search_torrentsfilter_optionsfilter_optionsfreeStateget_search_resultsfree_state使用选中的筛选条件获取结果:
node scripts/mp-cli.js get_search_results resolution='1080p,2160p' free_state='免费,50%'如果结果为空,告知用户可以放宽哪些筛选条件,重试前请先征求用户同意。
4. Present results as a numbered list
4. 以编号列表展示结果
Show all results without pre-selection. Each row: index, title, size, seeders, resolution, release group, , .
volume_factorfreedate_diff | Meaning |
|---|---|
| Free download |
| 50% download size |
| Double upload |
| Double upload + free |
| No discount |
freedate_diff2天3小时无需预选,展示所有结果。每行包含:序号、标题、大小、做种数、分辨率、发布组、、。
volume_factorfreedate_diff | 含义 |
|---|---|
| 免费下载 |
| 下载大小减半 |
| 双倍上传 |
| 双倍上传+免费下载 |
| 无折扣 |
freedate_diff2天3小时5. Check before downloading
5. 下载前检查
After the user picks torrents: Run Check Library and Subscriptions step.
If the media already exists in the library or is already subscribed, stop and report the finding to the user.
用户选择种子后:运行媒体库与订阅检查步骤。
如果媒体已存在于媒体库中或已被订阅,停止操作并将结果告知用户。
6. Add download
6. 添加下载
Download one or more torrents ( comes from output):
torrent_urlget_search_resultsnode scripts/mp-cli.js add_download torrent_url="abc1234:1,def5678:2"下载一个或多个种子(来自的输出):
torrent_urlget_search_resultsnode scripts/mp-cli.js add_download torrent_url="abc1234:1,def5678:2"Error handling
错误处理
| Step | Action |
|---|---|
| Retry with alternative title (English/original), inform user. Still empty → ask for title or TMDB ID. |
| Inform user, ask whether to retry with different sites. |
| Do not silently broaden filters. Suggest which filter to relax, ask before retrying. |
| Run |
| 步骤 | 操作 |
|---|---|
| 使用备选标题(英文/原名)重试,告知用户。如果仍然无结果→请用户提供标题或TMDB ID。 |
| 告知用户,询问是否更换站点重试。 |
| 不要悄悄放宽筛选条件。建议可以放宽的筛选条件,重试前先征求用户同意。 |
| 运行 |
Add Subscription
添加订阅
- Search for the media to get : Run
tmdb_id.search_media - Run Check Library and Subscriptions step, if media already exists or is subscribed, stop and report to user.
- If the user specifies a TV season, run Season Validation step first.
Subscribe to a movie or TV show:
node scripts/mp-cli.js add_subscribe title="..." year="2011" media_type="tv" tmdb_id=42009Subscribe to a specific season:
node scripts/mp-cli.js add_subscribe title="..." year="2011" media_type="tv" tmdb_id=42009 season=4Subscribe starting from a specific episode:
node scripts/mp-cli.js add_subscribe title="..." year="2024" media_type="tv" tmdb_id=12345 season=1 start_episode=13- 搜索媒体获取:运行
tmdb_id。search_media - 运行媒体库与订阅检查步骤,如果媒体已存在或已被订阅,停止操作并告知用户。
- 如果用户指定了电视剧季数,请先运行季数验证步骤。
订阅电影或电视剧:
node scripts/mp-cli.js add_subscribe title="..." year="2011" media_type="tv" tmdb_id=42009订阅指定季:
node scripts/mp-cli.js add_subscribe title="..." year="2011" media_type="tv" tmdb_id=42009 season=4从指定集开始订阅:
node scripts/mp-cli.js add_subscribe title="..." year="2024" media_type="tv" tmdb_id=12345 season=1 start_episode=13Manage Downloads
下载管理
List download tasks and get hash for further operations:
node scripts/mp-cli.js query_download_tasks status=downloadingDelete a download task (confirm with user first — irreversible):
node scripts/mp-cli.js delete_download hash=<hash>Delete a download task and also remove its files (confirm with user first — irreversible):
node scripts/mp-cli.js delete_download hash=<hash> delete_files=true列出下载任务并获取后续操作所需的哈希值:
node scripts/mp-cli.js query_download_tasks status=downloading删除下载任务(操作不可撤销,请先征得用户同意):
node scripts/mp-cli.js delete_download hash=<hash>删除下载任务并移除相关文件(操作不可撤销,请先征得用户同意):
node scripts/mp-cli.js delete_download hash=<hash> delete_files=trueManage Subscriptions
订阅管理
List active subscriptions:
node scripts/mp-cli.js query_subscribes status=RUpdate subscription filters:
node scripts/mp-cli.js update_subscribe subscribe_id=123 resolution="1080p"Trigger a search for missing episodes (confirm with user first):
node scripts/mp-cli.js search_subscribe subscribe_id=123Remove a subscription (confirm with user first):
node scripts/mp-cli.js delete_subscribe subscribe_id=123列出活跃订阅:
node scripts/mp-cli.js query_subscribes status=R更新订阅筛选条件:
node scripts/mp-cli.js update_subscribe subscribe_id=123 resolution="1080p"触发缺失剧集的搜索(请先征得用户同意):
node scripts/mp-cli.js search_subscribe subscribe_id=123删除订阅(操作不可撤销,请先征得用户同意):
node scripts/mp-cli.js delete_subscribe subscribe_id=123Check Library and Subscriptions
媒体库与订阅检查
Run before any download or subscription to avoid duplicates.
Check if the media already exists in the library:
node scripts/mp-cli.js query_library_exists tmdb_id=123456 media_type="movie"Check if the media is already subscribed:
node scripts/mp-cli.js query_subscribes tmdb_id=123456在任何下载或订阅操作前运行,避免重复。
检查媒体是否已存在于媒体库中:
node scripts/mp-cli.js query_library_exists tmdb_id=123456 media_type="movie"检查媒体是否已被订阅:
node scripts/mp-cli.js query_subscribes tmdb_id=123456Season Validation
季数验证
Mandatory when user specifies a season. Productions sometimes release a show in multiple parts under one TMDB season; online communities and torrent sites may label each part as a separate "season".
用户指定季数时必须执行此步骤。有时制作方会在TMDB的同一季下分多部分发布剧集,而社区和种子站点可能会将每个部分标记为单独的“季”。
1. Verify season exists
1. 验证季数是否存在
Fetch media detail to check available seasons:
node scripts/mp-cli.js query_media_detail tmdb_id=<id> media_type="tv"Compare with the user's requested season:
season_info- If the season exists in → use that season number directly and return to the calling workflow.
season_info - If the season does not exist → the user's "season" likely maps to a later episode range within an existing TMDB season. Note the latest (highest-numbered) season from , then continue to next step.
season_info
获取媒体详情查看可用季数:
node scripts/mp-cli.js query_media_detail tmdb_id=<id> media_type="tv"将与用户请求的季数进行对比:
season_info- 如果中存在该季→直接使用该季号,返回调用的工作流程。
season_info - 如果中不存在该季→用户所说的“季”很可能对应TMDB现有某一季中靠后的剧集范围。记下
season_info中最新(编号最大)的季数,继续下一步。season_info
2. Identify the correct episode range
2. 确定正确的剧集范围
Fetch episode schedule for the latest season from :
season_infonode scripts/mp-cli.js query_episode_schedule tmdb_id=<id> season=<latest_season_number>Use to find a block of recently-aired episodes that likely corresponds to what the user calls the missing season. Look for a gap in between episodes — the gap indicates a part break, and the episodes after the gap are what the user likely refers to as the next "season". For example, if TMDB Season 1 has episodes 1–24 and there is a multi-month gap between episode 12 and 13, then episodes 13–24 correspond to the user's "Season 2". If no such gap exists, tell user content is unavailable. Otherwise confirm the episode range with user.
air_dateair_date获取中最新一季的剧集播出时间表:
season_infonode scripts/mp-cli.js query_episode_schedule tmdb_id=<id> season=<latest_season_number>使用(播出日期)找到最近播出的剧集块,这部分很可能对应用户所说的缺失季数。查找剧集之间的间隔——间隔表示部分拆分,间隔后的剧集很可能就是用户所说的下一“季”。例如,如果TMDB第1季包含1-24集,第12集和第13集之间有几个月的间隔,那么13-24集就对应用户所说的“第2季”。如果不存在这样的间隔,告知用户内容不可用。否则请与用户确认剧集范围。
air_dateair_dateError handling
错误处理
Missing configuration: Ask the user for the backend host and API key. Once provided, save the config persistently — subsequent commands will use it automatically:
node scripts/mp-cli.js -h <HOST> -k <KEY>配置缺失:请用户提供后端地址和API密钥。获取后请持久化保存配置——后续命令会自动使用该配置:
node scripts/mp-cli.js -h <HOST> -k <KEY>