← Back to Skills Marketplace
maydayily

设备直播地址

by maydayily · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ✓ Security Clean
151
Downloads
0
Stars
0
Active Installs
2
Versions
Install in OpenClaw
/install closeli-live-url
Description
调用 ai-open-gateway 的设备直播接口 POST /api/device/live,获取指定设备的 H5 播放器直播链接。Use when: 需要远程查看设备实时画面、获取直播链接分享给他人。⚠️ 需设置 AI_GATEWAY_API_KEY。
README (SKILL.md)

设备直播链接接口

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-key API 密钥,用于接口鉴权。脚本按此优先级自动获取

可选配置

配置项 传递方式 默认值 说明
AI_GATEWAY_HOST 环境变量、~/.openclaw/.env https://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/list POST 获取设备名称映射
/api/device/live POST 获取设备直播链接

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

快速开始

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

请求格式

请求体

参数名 类型 必填 说明
device_id string 设备 ID,格式: xxxxS_\x3Cmac>,不能为空

响应格式

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

data 字段

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

错误码

错误码 HTTP 状态码 说明
1001 401 未提供 api_key(缺少 Authorization 头或格式不正确)
1002 401 api_key 无效或已禁用
2001 400 缺少必要参数(device_id 为空,或设备不属于当前用户)
3001 502 网关内部服务调用失败
3004 502 网关内部服务调用失败
5000 500 内部错误

注意事项

  • device_id 不能为空,否则返回错误码 2001
  • 设备不属于当前用户时会直接报错
  • 建议每次播放前重新获取链接(token 有时效性)
  • 全局请求超时为 120 秒
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: closeli-live-url Version: 1.0.1 The skill is a legitimate tool for retrieving H5 live stream URLs for IoT devices via the Closeli AI gateway. The Python script (get_live_url.py) and instructions (SKILL.md) demonstrate transparent credential handling, proper use of the httpx library for API requests, and include explicit security warnings regarding TLS verification and shared configuration files. No evidence of data exfiltration, unauthorized execution, or malicious prompt injection was found.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install closeli-live-url
  3. After installation, invoke the skill by name or use /closeli-live-url
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.1
- Minor metadata adjustment: The "requires" section in metadata now lists configPaths, aligning the documentation with the implementation. - No functionality or behavior changes; all configuration and usage details remain the same.
v1.0.0
Initial release of the device live URL retrieval skill. - Provides a command-line tool to obtain browser-friendly live stream links for specific devices via ai-open-gateway. - Requires Python 3 and httpx; CLI usage documented with sample command. - Needs an API key (AI_GATEWAY_API_KEY) and may optionally use other gateway config variables. - Structured output rules ensure user-friendly, Markdown-formatted response; errors displayed with reason and code. - Streams are protected—proper security and environment setup is emphasized in documentation.
Metadata
Slug closeli-live-url
Version 1.0.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 2
Frequently Asked Questions

What is 设备直播地址?

调用 ai-open-gateway 的设备直播接口 POST /api/device/live,获取指定设备的 H5 播放器直播链接。Use when: 需要远程查看设备实时画面、获取直播链接分享给他人。⚠️ 需设置 AI_GATEWAY_API_KEY。 It is an AI Agent Skill for Claude Code / OpenClaw, with 151 downloads so far.

How do I install 设备直播地址?

Run "/install closeli-live-url" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 设备直播地址 free?

Yes, 设备直播地址 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 设备直播地址 support?

设备直播地址 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 设备直播地址?

It is built and maintained by maydayily (@maydayily); the current version is v1.0.1.

💬 Comments