设备直播地址

v1.0.1

调用 ai-open-gateway 的设备直播接口 POST /api/device/live,获取指定设备的 H5 播放器直播链接。Use when: 需要远程查看设备实时画面、获取直播链接分享给他人。⚠️ 需设置 AI_GATEWAY_API_KEY。

0· 146·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for maydayily/closeli-live-url.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "设备直播地址" (maydayily/closeli-live-url) from ClawHub.
Skill page: https://clawhub.ai/maydayily/closeli-live-url
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Required env vars: AI_GATEWAY_API_KEY
Required binaries: python3
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install closeli-live-url

ClawHub CLI

Package manager switcher

npx clawhub@latest install closeli-live-url
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description: fetch device live H5 URL. Requested binary (python3), primary environment variable (AI_GATEWAY_API_KEY), and the two API endpoints (/api/device/list and /api/device/live) all match that purpose. The script also documents optional host and TLS flags which are expected for an API client.
Instruction Scope
SKILL.md instructs the agent to run the script, parse its JSON output, and present a formatted Markdown link. The bundled Python script prints only the declared JSON response and calls only the two described endpoints. There is no instruction to read unrelated system files or to exfiltrate data to other endpoints. The SKILL.md's requirement that the agent reformat JSON into a user-friendly link is consistent with the script output.
Install Mechanism
No install spec; this is instruction + single script. The only runtime dependency is the widely used Python package httpx (the script prompts to install it). There are no downloads from arbitrary URLs or archive extraction steps.
Credentials
The skill requires a single primary credential AI_GATEWAY_API_KEY, which is appropriate. However, the script supports a fallback of reading ~/.openclaw/.env (declared in SKILL.md and metadata) — that file is shared by other skills and could contain additional secrets. SKILL.md warns about this and provides AI_GATEWAY_NO_ENV_FILE to disable fallback; users should prefer environment variables and not rely on the shared .env in production. The optional AI_GATEWAY_VERIFY_SSL flag can disable TLS verification (documented as for development only) — avoid disabling in production.
Persistence & Privilege
Skill is user-invocable, not always-enabled, and does not request persistent system-wide privileges or modify other skills. It does not require elevated OS permissions.
Assessment
This skill appears to do exactly what it says: call your ai-open-gateway to get a device's H5 live-player URL. Before installing or running, ensure you: (1) provide a least-privilege AI_GATEWAY_API_KEY via environment variable (not a shared file); (2) avoid leaving AI_GATEWAY_NO_ENV_FILE unset in production if your ~/.openclaw/.env is shared with other skills; (3) do not disable TLS verification (AI_GATEWAY_VERIFY_SSL) in production; and (4) verify AI_GATEWAY_HOST points to a trusted domain. If any of those are concerns in your environment, address them before use.

Like a lobster shell, security has layers — review code before you run it.

Runtime requirements

Binspython3
EnvAI_GATEWAY_API_KEY
Primary envAI_GATEWAY_API_KEY
latestvk97c9es9a8pq4q6sqrv41t3fvn83h9kq
146downloads
0stars
2versions
Updated 1mo ago
v1.0.1
MIT-0

设备直播链接接口

POST /api/device/live 用于获取指定设备的 H5 播放器直播链接。接口会校验设备归属,然后返回可直接在浏览器中打开的播放器 URL。

⚠️ 展示规则(MUST 严格遵守)

脚本输出 JSON 格式的结构化数据,这是预期行为。以下展示规则是给 agent 的格式化指令:agent MUST 解析脚本输出的 JSON,按下述规则转换为用户友好的格式后再展示,MUST NOT 直接展示原始 JSON。

脚本输出中包含 _device_name 字段(设备名称),用于展示。

  1. code == 0data 包含 live_url 时,MUST 使用 Markdown 链接格式:

📺 「客厅摄像机」的直播:

▶️ 点击打开直播播放器

关键规则:

  • _device_name 获取设备名称,用「设备名称」展示,而不是 MAC 地址
  • 如果 _device_name 为空,则用去掉 xxxxS_ 前缀的 MAC 地址作为备选
  • live_url MUST 用 Markdown 链接语法 [文字](url) 输出,MUST NOT 输出裸 URL 文本
  • 链接文字用 ▶️ 点击打开直播播放器
  1. code != 0 时,回复:"接口调用失败,错误码 {code},原因:{message}"

前置依赖

脚本依赖 httpx。如果未安装,脚本会提示 python3 -m pip install httpx

配置声明

本 skill 依赖以下配置项,agent 和用户 MUST 在运行前确认已正确配置。

必需配置

配置项传递方式说明
AI_GATEWAY_API_KEY环境变量(推荐)、~/.openclaw/.env(fallback)、命令行 --api-keyAPI 密钥,用于接口鉴权。脚本按此优先级自动获取

可选配置

配置项传递方式默认值说明
AI_GATEWAY_HOST环境变量、~/.openclaw/.envhttps://ai-open-gateway.closeli.cn网关地址
AI_GATEWAY_VERIFY_SSL环境变量true设为 false 可禁用 TLS 证书验证(仅限开发环境)
AI_GATEWAY_NO_ENV_FILE环境变量false设为 true 可禁用 ~/.openclaw/.env fallback 读取(生产环境推荐)

Fallback 配置路径

脚本默认会读取 ~/.openclaw/.env 文件作为 fallback 配置源。该文件为所有 skill 共享,格式为 KEY=VALUE(每行一条)。生产环境 MUST 设置 AI_GATEWAY_NO_ENV_FILE=true 禁用此 fallback,改为通过环境变量直接传递所有配置。

安全注意事项

  • 共享凭证文件 ~/.openclaw/.env 可被同一用户下所有 skill 读取。生产环境 MUST 通过环境变量传递 API_KEY,MUST NOT 依赖共享凭证文件
  • TLS 证书验证默认启用,MUST NOT 在生产环境禁用(禁用会导致中间人攻击风险,攻击者可截获 API_KEY 和设备数据)
  • 使用前 MUST 确认 AI_GATEWAY_HOST 指向可信域名
  • MUST 使用最小权限的 API_KEY,避免复用高权限凭证。本 skill 仅需设备直播链接获取权限

网络访问声明

本 skill 仅访问以下端点(均为 AI_GATEWAY_HOST 下的路径):

端点方法用途
/api/device/listPOST获取设备名称映射
/api/device/livePOST获取设备直播链接

脚本不访问任何其他网络资源。

快速开始

python3 get_live_url.py --device-id "xxxxS_aabbccddeeff"

请求格式

请求体

参数名类型必填说明
device_idstring设备 ID,格式: xxxxS_<mac>,不能为空

响应格式

{
  "code": 0,
  "message": "success",
  "request_id": "<32位请求追踪ID>",
  "data": {
    "live_url": "https://example.com/h5player/pro/autoPlay.html?..."
  },
  "_device_name": "客厅摄像机"
}

data 字段

参数名类型说明
live_urlstringH5 播放器直播链接,可直接在浏览器或 WebView 中打开

错误码

错误码HTTP 状态码说明
1001401未提供 api_key(缺少 Authorization 头或格式不正确)
1002401api_key 无效或已禁用
2001400缺少必要参数(device_id 为空,或设备不属于当前用户)
3001502网关内部服务调用失败
3004502网关内部服务调用失败
5000500内部错误

注意事项

  • device_id 不能为空,否则返回错误码 2001
  • 设备不属于当前用户时会直接报错
  • 建议每次播放前重新获取链接(token 有时效性)
  • 全局请求超时为 120 秒

Comments

Loading comments...