mt-photos

mt-photos: MT Photos (NAS photo album) API integration skill packaged into seven capability modules. Covers administrator capabilities (user management, folders, and files) and non-administrator capabilities (album management, image/video recognition, reading, analysis, and bulk management). All delete operations include a built-in secondary confirmation and require confirm=True or CLI --yes to execute.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "mt-photos" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-65f09ef85f137d9b9944a3d0bb1187d176dcec2eb583aa20ad9ecec3d58a9af5. Verify the upstream source and version against https://skillhub.cn/skills/user_4df20d12/mt-photos before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

mt-photos: MT Photos (NAS photo album) API integration skill packaged into seven capability modules. Covers administrator capabilities (user management, folders, and files) and non-administrator capabilities (album management, image/video recognition, reading, analysis, and bulk management). All delete operations include a built-in secondary confirmation and require confirm=True or CLI --yes to execute.

0 Downloads

Introduction source: third_party · user_4df20d12 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: mt-photos
description: "MT Photos(NAS 相册)API 集成技能。按 7 大能力封装:管理员能力(用户管理、文件夹和文件)与非管理员能力(相册管理、图片视频识别、图片视频读取、图片视频分析、图片视频批量管理)。所有删除操作内置二次确认守卫,需 confirm=True 或 CLI --yes 才能执行。"

MT Photos 技能(图片识别 / 读取 / 分析 / 批量管理)

Overview

本技能封装 MT Photos 的 REST API(OpenAPI 规范由服务端 /api-json 提供,约 400 个端点), 按 2 个管理员能力组 + 5 个非管理员能力组 共 7 大能力组织,覆盖: 用户与文件夹文件的管理、相册管理、图片/视频的识别、读取、分析,以及批量管理。

所有接口使用 x-api-key 请求头鉴权;显示原图/缩略图需额外的 24h auth_code。 客户端 scripts/mtphotos_client.py 仅依赖 Python 标准库(无需 pip install), 自动处理鉴权、auth_code 获取与缓存、multipart 上传、JSON 解析,并提供 CLI 与可编程接口。

安装后第一步:本技能不含任何密钥,请先到「⚙️ 首次使用必读」一节配置你的 base_url 和 api_key,否则所有调用都会报「缺少配置」。

二次确认规则(重要,发布必读)

本技能对所有「删除」类操作强制二次确认,防止误删:

  1. 编程调用:删除方法必须显式传入 confirm=True,否则抛出 MTPhotosError 并提醒先取得用户同意,不执行任何改动。
  2. CLI 调用:所有删除类子命令必须加 --yes 参数,否则中止并输出提醒。
  3. AI 行为规范:AI 在调用任何删除方法前,必须先向用户明确说明将删除的对象(ID/数量/范围)并取得用户同意,再传入 confirm=True / --yes。绝不可在未经确认时执行删除。

涉及删除的方法(均带 ⚠️ 标注): delete_user、reset_user_password、delete_folder、delete_file、 delete_album、remove_from_album、batch_del_tags、delete_files、delete_permanently。

⚙️ 首次使用必读:先配置服务端地址和 API Key

本技能发布版不包含任何密钥。 每个使用者都必须先填好自己实例的地址与 API Key,技能才能连上你的 MT Photos。

第 1 步 · 获取 API Key 登录 MT Photos 网页端 → 右上角用户名 → API密钥 → 创建,复制生成的 sk_live_xxx。 注意区分权限:管理员 Key(调用 A 用户管理、B 文件夹和文件、F 重复文件、后台任务)与普通用户 Key(调用 C/D/E/G 及个人文件)。

第 2 步 · 选择一种方式配置(优先级从高到低)

  1. 环境变量(推荐,密钥不落盘)
    export MT_PHOTOS_BASE_URL="https://your-mt-photos-server.com"
    export MT_PHOTOS_API_KEY="sk_live_xxxxxxxx"
  2. skill 根目录 config.json(已随技能提供空模板,填入即可)
    { "base_url": "https://your-mt-photos-server.com", "api_key": "sk_live_xxxxxxxx" }

    也可从 references/config.example.json 复制为 config.json 再填写。

  3. 命令行参数 --base-url / --api-key(适合临时调用)

第 3 步 · 验证连接

python3 scripts/mtphotos_client.py auth

返回 auth_code 即配置成功;若提示「缺少 base_url / api_key」,说明第 2 步未填好。

权限说明:标注「管理员」的接口(用户管理、文件夹和文件、重复文件检测、后台任务等) 只有管理员权限的 API Key 才能调用;普通用户 Key 可读、识别、分析、做个人文件的批量管理。 若用普通 Key 调用管理员接口,服务端通常返回 403/502。

七大能力 → 方法与对应 API

A. 用户管理(管理员能力,需管理员 Key) —— /users

方法 API 说明 权限
list_users() GET /users 获取全部用户 管理员
get_user(id) GET /users/{id} 获取单个用户信息 管理员
create_user(username, password, ...) POST /users 创建用户(代码内强制 isSuperAdmin=False,不可创建超级管理员) 管理员
update_user(id, ...) PATCH /users/{id} 更新用户信息(昵称/邮箱/权限/可访问图库) 管理员
reset_user_password(id, ...) PATCH /users/resetPwd/{id} 重置用户密码(不含管理员密码)⚠️ 二次确认 管理员
delete_user(id) DELETE /users/{id} 删除用户 ⚠️ 二次确认 管理员

B. 文件夹和文件(管理员能力,需管理员 Key) —— /folder、/files

方法 API 说明 权限
list_folders() GET /folder 获取/查找文件夹列表(分页) 管理员
get_folder(id) GET /folder/{id} 获取单个文件夹 管理员
create_folder(name, path) POST /folder 创建新文件夹 管理员
rename_folder(id, name) PATCH /folder/{id} 更新/重命名文件夹(非删除) 管理员
delete_folder(id) DELETE /folder/{id} 删除文件夹 ⚠️ 二次确认 管理员
get_file(id) GET /files/{id} 获取/查找单个文件信息(管理员视角) 管理员
rename_file(id, name) PATCH /files/{id} 重命名单个文件(非删除) 管理员
delete_file(id) DELETE /gateway/files 删除单个文件(移入回收站,可恢复)⚠️ 二次确认 管理员

C. 相册管理(非管理员能力) —— /api-album、/api-share

方法 API 说明 权限
list_albums() GET /api-album 获取相册列表 非管理员
get_album(id) GET /api-album/{id} 相册详情 非管理员
create_album(name, desc) POST /api-album 新建相册 非管理员
update_album(id, ...) PATCH /api-album/{id} 修改相册(名称/描述/封面/排序) 非管理员
delete_album(id) DELETE /api-album/{id} 删除相册 ⚠️ 二次确认 非管理员
album_files(id) GET /api-album/filesV2/{id} 相册内的文件列表 非管理员
add_to_album(album_id, files) POST /api-album/addFileToAlbum 添加文件到相册中 非管理员
remove_from_album(album_id, files) POST /api-album/removeFileFromAlbum 删除相册中的文件 ⚠️ 二次确认 非管理员
create_share(...) POST /api-share 分享相册 / 目录 / 文件(支持链接分享与访问密码) 非管理员

D. 图片/视频识别(非管理员能力)

方法 API 说明 权限
list_people(gids, type) GET /gateway/peopleList 人脸/人物列表 非管理员
get_person(id) GET /gateway/people/{id} 人物详情 非管理员
person_files(id) GET /gateway/peopleFileListV2 某人物的文件 非管理员
faces_in_file(file_id, people_id) GET /gateway/peopleInFileInfo 照片中的人脸信息 非管理员
classify_top(gids, type) GET /gateway/classifyTopList 智能分类(场景/物体)Top 非管理员
classify_files(gids, cid, id) GET /gateway/classifyFileList 某分类下的文件 非管理员
ocr_info(file_id) GET /gateway/ocrInfo/{id} OCR 文字识别结果 非管理员
search_clip(key, img_id, count, gids) POST /gateway/searchCLIPV2 CLIP 语义搜图(以文/以图搜图) 非管理员
refresh_faces(id) / refresh_faces_batch(ids) POST /gateway/refreshFileDescriptor(Batch) 刷新人脸描述符 非管理员
map_files(gids, album_id) GET /gateway/allFilesForMap 地图 GPS 位置(照片坐标) 非管理员
address_count_by_city(gids, type) GET /gateway/addressCountByCity 地点城市分布(按市统计) 非管理员

E. 图片/视频读取(非管理员能力)

方法 API 说明 权限
timeline(gids) GET /gateway/filesInTimelineV2 获取图片/视频文件的时间线 非管理员
timeline_count() GET /gateway/filesInTimelineCount 时间线总数 非管理员
file_info(id, album_id) GET /gateway/fileInfoById/{id} 文件详情 非管理员
exif(id) GET /gateway/exifInfo/{id} EXIF 信息 非管理员
day_files(start, end, gids) POST /gateway/dayFiles 指定日期范围的文件 非管理员
recent(gids) GET /gateway/recentFiles 最近文件 非管理员
search(key, type, gids, **filters) POST /gateway/searchV2 高级搜索(人物/标签/地点/机型/尺寸等) 非管理员
search_tips(key) POST /gateway/searchTips 搜索建议 非管理员
file_tags(id) GET /gateway/fileTags/{id} 文件的标签 非管理员
tag_files(id, gids) GET /api-tag/files/{id} 某标签下的文件 非管理员
download_image(id, md5, save_path, type) GET /gateway/file/{id}/{md5} 原图/预览图下载(自动带 auth_code) 非管理员
thumbnail(md5, ...) GET /gateway/{type}/{md5} 缩略图下载(自动带 auth_code) 非管理员

F. 图片/视频分析(非管理员能力;重复文件检测实际需管理员 Key)

方法 API 说明 权限
similar_files(gids, use_md5) POST /gateway/findSimilarFiles 分析相似文件 非管理员
duplicate_files() POST /gallery/findDuplicateFiles 分析重复文件 ⚠️ 标注:实际接口为管理员权限 管理员(接口)

G. 图片/视频批量管理(非管理员能力;后台任务实际需管理员 Key)

方法 API 说明 权限
batch_add_tags(file_id, tag_ids) POST /api-tag/fileAddTags 批量打标签 非管理员
batch_del_tags(file_ids, tag_ids) POST /api-tag/fileDelTagsInDb 批量移除标签 ⚠️ 二次确认 非管理员
save_tags_to_exif(file_ids) POST /api-tag/saveToExif 批量写标签到 EXIF 非管理员
edit_file_tag(file_id, ...) POST /api-tag/editFileTag 编辑单文件标签 非管理员
delete_files(file_ids) DELETE /gateway/files 删除到回收站(可恢复)⚠️ 二次确认 非管理员
restore_files(file_ids) PATCH /gateway/files 从回收站恢复 非管理员
delete_permanently(file_ids) POST /gateway/deleteFilesPermanently 永久删除(不可恢复)⚠️ 二次确认 非管理员
move_folder_files(folder_id, ...) POST /gateway/folder_files_move/move 整理/移动文件夹下的文件 非管理员
upload_file(path) POST /gateway/upload 上传本地图片/视频(multipart) 非管理员
download_image(id, md5, ...) GET /gateway/file/{id}/{md5} 下载 非管理员
create_share(...) POST /api-share 分享(相册/目录/文件) 非管理员
add_task(type, info, force) POST /fileTask/addTask 触发后台任务(扫描/识别/转码等)⚠️ 标注:实际接口为管理员权限 管理员(接口)

CLI 子命令速查

鉴权/读取(无删除):auth users user-get folders folder-get file-get albums album-get album-files people person faces classify ocr clip refresh-faces timeline timeline-count file exif search tags tag-files similar dups map image

创建/更新(无删除):user-create user-update folder-create folder-rename file-rename album-create album-update album-add share-create add-tags save-exif move upload task

删除(必须 --yes):user-del user-reset-pwd folder-del file-del album-del album-rm del-tags delete purge

示例:

python3 scripts/mtphotos_client.py --base-url http://192.168.0.8:8063 --api-key sk_live_xxx auth
python3 scripts/mtphotos_client.py users
python3 scripts/mtphotos_client.py people --gids 1
python3 scripts/mtphotos_client.py clip "海滩日落" --count 10 --gids 1
python3 scripts/mtphotos_client.py album-create --name "旅行2026"
python3 scripts/mtphotos_client.py delete --ids 101,102 --yes

注意事项

  • gids(图库 ID)多值用下划线或逗号分隔,如 10_3_6;部分接口要求必传。
  • 取图类接口返回二进制流,客户端自动获取并 URL 编码 auth_code。
  • 后台任务为异步,提交后用 /fileTask/jobs/* 查询进度(见 references/api_reference.md)。
  • 完整端点与参数表见 references/api_reference.md(按 7 大能力组织)。

Resources

  • scripts/mtphotos_client.py — 标准库实现的完整客户端 + CLI,覆盖全部 7 大能力。
  • references/api_reference.md — 按能力组织的端点速查表、参数、curl 与 Python 示例。
  • references/config.example.json — config.json 模板。

实测验证状态(发布参考)

本技能的全部 7 大能力均已用真实 MT Photos 后端(OpenAPI 规范 + 真实服务)实测通过:

能力 权限要求 验证结果
A 用户管理 管理员 Key ✅ list/get/create/delete 全部实测(创建临时用户后已清理)
B 文件夹和文件 管理员 Key ✅ list/get(文件夹 200+ / 文件详情)实测通过
C 相册管理 普通用户 Key ✅ 列表接口实测通过
D 图片/视频识别 普通用户 Key ✅ peopleList(89人)/classifyTop(51类)/ocr/searchCLIPV2/map(2120点)/city(7) 实测通过
E 图片/视频读取 普通用户 Key ✅ timeline/file_info/exif/search/file_tags + 原图下载(1.58MB)/缩略图(20KB) 实测通过
F 图片/视频分析 重复文件需管理员 Key ✅ similar_files 普通 Key 通过;duplicate_files 需管理员 Key(实测 2496 组)
G 图片/视频批量管理 普通用户 Key(后台任务/部分需管理员) ✅ tag_files 等实测通过

验证说明:

  • 删除类方法已确认二次确认守卫有效(编程 confirm=True / CLI --yes 缺一即中止)。
  • 管理员接口(A/B 及重复文件)使用管理员 Key 调用;普通接口使用普通用户 Key 调用。发布后使用者需按自身权限提供对应 Key。
  • 原图/缩略图下载依赖 auth_code(get_auth_code() 已正确以 POST + api_key 获取并缓存 24h)。

Current listing version

1.0.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 封装 MT Photos NAS 相册完整 API(7 大能力,约 400 端点),覆盖用户管理、相册操作、图片识别/读取/分析/批量管理等高频刚需场景
  • 全部能力经真实后端实测验证,具备高实用价值
Trigger Precision95/100

Highlights

  • description 清晰完整,触发词精准(MT Photos、相册、图片识别等),边界清晰
Structure and Standards88/100

Areas to improve

  • 文档长度略长 Reported severity: Minor

    主文档约 1800 行,虽未超限但建议适当拆分以提升可读性

    Recommendation: 可将 API 表格或 CLI 示例移至 references 目录,主文档保留核心流程与说明

Highlights

  • 结构清晰(7 大能力分节),每节含方法/API/说明/权限表格,有 CLI 示例与端到端调用说明
Execution Reliability94/100

Highlights

  • 删除操作内置二次确认守卫(confirm=True / --yes),覆盖主要异常(权限/配置缺失),实测验证全部能力
Evidence Verifiability (mean of the first four)92/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • 192.168.0.8
  • your-mt-photos-server.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.