Install
openclaw skills install jf-open-pro-capture杰峰设备批量抓图技能(开发版)。支持多设备同时抓图,自动管理 Token,可选下载图片到本地。按调用次数计费。
openclaw skills install jf-open-pro-capture支持杰峰设备云抓图功能,适用于单设备或多设备批量抓图:
计费说明: 按调用次数计费,详见 杰峰官网 - 云抓拍定价
| 变量名 | 说明 | 默认值 | 必需 |
|---|---|---|---|
JF_UUID | 开放平台用户 uuid | - | ✅ |
JF_APP_KEY | 开放平台应用 appKey | - | ✅ |
JF_APP_SECRET | 开放平台应用密钥 | - | ✅ |
JF_MOVE_CARD | 移动卡标识(用于签名) | 2 | ✅ |
JF_DEVICE_SN | 设备序列号(单设备) | - | ❌ |
JF_DEVICE_TOKEN | 设备接口访问令牌 | - | ❌ |
JF_DEVICE_USERNAME | 设备用户名 | admin | ❌ |
JF_DEVICE_PASSWORD | 设备密码 | - | ❌ |
JF_ENDPOINT | API 接入地址 | api-cn.jftechws.com | ❌ |
| 功能 | 地址 | 方法 | 需要 Token | 需要在线 |
|---|---|---|---|---|
| 设备抓图 | POST /gwp/v3/rtc/device/capture/{token} | POST | ✅ | ✅ |
| 获取设备 Token | POST /gwp/v3/rtc/device/token | POST | ✅ | ❌ |
API: POST /gwp/v3/rtc/device/capture/{deviceToken}
Name: OPSNAP
请求参数:
| 参数 | 类型 | 必需 | 默认值 | 说明 |
|---|---|---|---|---|
| Name | string | ✅ | OPSNAP | 固定值 |
| OPSNAP.Channel | int | ❌ | 0 | 通道号(0=第一通道) |
| OPSNAP.PicType | int | ❌ | 0 | 图片类型(0=实时图,1=缩略图) |
响应参数:
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 平台状态码(2000=成功) |
| msg | string | 响应消息 |
| data | object | 响应数据 |
| ├─ Ret | int | 设备状态码(100=成功) |
| └─ image | string | 图片地址 URL(有效期 24 小时) |
API: POST /gwp/v3/rtc/device/token
请求参数:
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
| sns | string[] | ✅ | 设备序列号列表(最多 500 个) |
| accessToken | string | ❌ | 用户 accessToken(可选) |
响应参数:
| 字段 | 类型 | 说明 |
|---|---|---|
| data | object[] | 设备 Token 列表 |
| ├─ sn | string | 设备序列号 |
| └─ token | string | 设备接口访问令牌(有效期 24 小时) |
# 设置环境变量(请替换为您的实际配置)
export JF_UUID="your-uuid"
export JF_APP_KEY="your-app-key"
export JF_APP_SECRET="your-app-secret"
export JF_MOVE_CARD="2"
export JF_DEVICE_SN="your-device-sn"
export JF_DEVICE_TOKEN="your-device-token"
export JF_DEVICE_USERNAME="admin"
export JF_DEVICE_PASSWORD="your-device-password"
export JF_ENDPOINT="api-cn.jftechws.com"
cd ~/.openclaw/workspace/skills/developer/jf-open-pro-capture/scripts
# 抓取实时图(辅码流)
python3 capture.py --action capture \
--device-sn "your-device-sn" \
--device-token "your-device-token"
# 抓取缩略图
python3 capture.py --action capture --pic-type 1 \
--device-sn "your-device-sn" \
--device-token "your-device-token"
# 抓取第二通道
python3 capture.py --action capture --channel 1 \
--device-sn "your-device-sn" \
--device-token "your-device-token"
# 自动获取 Token 并抓图
python3 capture.py --action capture-auto \
--device-sn "your-device-sn" \
--password "your-device-password"
# 批量抓图(从文件读取设备列表)
python3 capture.py --action batch-capture \
--devices-file "devices.txt" \
--password "your-device-password"
# 批量抓图并下载
python3 capture.py --action batch-capture \
--devices-file "devices.txt" \
--password "your-device-password" \
--download --output-dir "./captures"
# 抓图并下载到当前目录
python3 capture.py --action capture \
--device-sn "your-device-sn" \
--device-token "your-device-token" \
--download
# 抓图并下载到指定目录
python3 capture.py --action capture \
--device-sn "your-device-sn" \
--device-token "your-device-token" \
--download --output-dir "./captures"
# 抓取第一通道
python3 capture.py --action capture --channel 0 \
--device-sn "your-device-sn" \
--device-token "your-device-token"
# 抓取第二通道
python3 capture.py --action capture --channel 1 \
--device-sn "your-device-sn" \
--device-token "your-device-token"
# 单设备抓图 - JSON 格式
python3 capture.py --action capture-auto \
--device-sn "your-device-sn" \
--password "your-device-password" \
--json
# 输出:{"url": "https://..."}
# 批量抓图 - JSON 格式
python3 capture.py --action batch-capture \
--devices-file "devices.txt" \
--password "your-device-password" \
--json
# 输出:{"total":3,"success":3,"failed":0,"results":[...]}
# devices.txt - 设备列表文件
# 格式:设备序列号,设备名称(可选)
your-device-sn-01,大门摄像头
your-device-sn-02,后院摄像头
your-device-sn-03,客厅摄像头
| 值 | 类型 | 说明 |
|---|---|---|
0 | 实时图 | 当前播放画面的截图(默认,辅码流) |
1 | 缩略图 | 缩略图(较小尺寸) |
| 值 | 说明 |
|---|---|
0 | 第一通道(默认) |
1 | 第二通道 |
2+ | 更多通道(NVR 设备) |
| code | 说明 | 处理建议 |
|---|---|---|
| 2000 | 成功 | - |
| 28007 | Header 参数错误 | 检查 uuid、appKey、timeMillis、signature |
| 40103 | 无效 Token | deviceToken 过期,重新获取 |
| 50000 | 服务器内部错误 | 联系杰峰技术支持 |
| Ret | 说明 | 处理建议 |
|---|---|---|
| 100 | 成功 | - |
| 106 | 用户名或密码错误 | 检查设备凭证 |
| 503 | 设备离线 | 检查设备在线状态 |
| 文件 | 说明 |
|---|---|
jf-open-pro-capture-skill.md | 技能文档 |
scripts/capture.py | Python 执行脚本 |
scripts/crypto.py | 签名/时间戳加密工具(复用) |