← 返回 Skills 市场
79
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install dlna
功能描述
Use when controlling DLNA/UPnP media renderers (smart TVs, speakers) on a local network - discovering devices, playing media URLs, controlling playback (play...
使用说明 (SKILL.md)
DLNA/UPnP Control
Overview
Control DLNA/UPnP MediaRenderer devices (smart TVs, speakers) on the local network. Uses async_upnp_client library for SSDP discovery and SOAP-based device control.
When to Use
- Need to discover and list DLNA devices on LAN
- Play media URLs on smart TVs or DLNA speakers
- Control playback (play, pause, stop, seek)
- Query current transport/position status
- Set default device for simplified operations
- Build CLI or Python API for DLNA device control
Core Pattern
1. Device Discovery
from async_upnp_client import SsdpListener
async def discover_media_renderers(timeout: float = 5.0) -> list[DeviceInfo]:
"""Discover all MediaRenderer devices on network"""
listener = SsdpListener()
await listener.async_start()
await asyncio.sleep(timeout)
devices = []
for usn, location in listener.unique_locations():
device = await listener.async_get_device(location)
if device and "MediaRenderer" in device.device_type:
devices.append(DeviceInfo(
name=device.friendly_name,
udn=device.udn,
location=location
))
await listener.async_stop()
return devices
2. Media Playback Control
from async_upnp_client import AsyncUPnPClient, AVTransport
async def play_media(device_url: str, media_url: str, title: str = None):
"""Play media URL on DLNA device"""
async with httpx.AsyncClient() as client:
device = await UPnPDevice.async_get_device(device_url, client=client)
av_transport = device.service("urn:schemas-upnp-org:service:AVTransport:1")
# Build DIDL-Lite metadata
metadata = f'''\x3C?xml version="1.0" encoding="utf-8"?>
\x3CDIDL-Lite xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
\x3Citem id="0" parentID="0" restricted="0">
\x3Cdc:title>{title or 'Media'}\x3C/dc:title>
\x3Cres protocolInfo="http-get:*:video/mp4:*">{media_url}\x3C/res>
\x3C/item>
\x3C/DIDL-Lite>'''
await av_transport.action("Stop", InstanceID=0)
await av_transport.action("SetAVTransportURI", InstanceID=0, CurrentURI=media_url, CurrentURIMetaData=metadata)
await av_transport.action("Play", InstanceID=0, Speed="1")
3. Transport Status Query
async def get_playback_status(av_transport) -> dict:
"""Query current playback state"""
info = await av_transport.action("GetTransportInfo", InstanceID=0)
position = await av_transport.action("GetPositionInfo", InstanceID=0)
return {
"state": info.get("CurrentTransportState"), # PLAYING, PAUSED, STOPPED
"position": position.get("RelTime"),
"duration": position.get("TrackDuration")
}
Quick Reference
| Action | Method |
|---|---|
| Discover devices | SsdpListener().unique_locations() |
| Play | AVTransport.action("Play", InstanceID=0, Speed="1") |
| Pause | AVTransport.action("Pause", InstanceID=0) |
| Stop | AVTransport.action("Stop", InstanceID=0) |
| Seek | AVTransport.action("Seek", InstanceID=0, Unit="REL_TIME", Target="01:00:00") |
| Volume | RenderingControl.action("SetVolume", InstanceID=0, DesiredVolume=50) |
| Status | AVTransport.action("GetTransportInfo", InstanceID=0) |
Common Mistakes
| Issue | Fix |
|---|---|
| SSDP timeout | Increase timeout to 5-10s; check firewall allows UDP 1900 |
| Play fails silently | Verify media URL is accessible from TV network; check content type |
| Wrong content type | Match protocolInfo to actual MIME type (video/mp4, audio/wav) |
| Device not found | Use exact UDN or IP:port from discovery; check device supports MediaRenderer |
CLI Framework
Use Click for CLI:
import click
import asyncio
@click.group()
def cli():
"""DLNA/UPnP Media Controller"""
pass
@cli.command()
@click.option("--timeout", "-t", default=5)
def discover(timeout):
"""Discover DLNA devices on network"""
...
@cli.command()
@click.argument("media_url")
@click.option("--device", "-d")
def play(media_url, device):
"""Play media URL"""
...
Dependencies
dependencies = [
"async_upnp_client>=0.36.0",
"click>=8.0.0",
"httpx>=0.25.0",
]
安全使用建议
This skill appears coherent and focused on DLNA/UPnP control, but consider the following before installing: (1) It requires local network access—SSDP discovery will probe the LAN (UDP 1900); run it only on trusted networks. (2) Playing arbitrary media URLs causes your devices to fetch external content; avoid untrusted URLs to prevent exposing device/network metadata or serving malicious content. (3) The SKILL.md lists Python dependencies but includes no install automation—verify and pin dependency versions before installing. (4) If you need stronger isolation, run the code in a restricted environment or network segment that limits access to sensitive devices. If you want extra assurance, request the actual implementation code (not just instructions) and review it for unexpected network calls or file access.
功能分析
Type: OpenClaw Skill
Name: dlna
Version: 1.0.0
The skill bundle provides standard functionality for discovering and controlling DLNA/UPnP media devices on a local network using the async_upnp_client library. The code snippets and instructions in SKILL.md are consistent with the stated purpose and do not contain any malicious patterns, data exfiltration, or prompt injection attacks.
能力评估
Purpose & Capability
Name/description align with the content: the SKILL.md describes SSDP discovery and AVTransport control using async_upnp_client and related libraries. Required capabilities (network access to LAN devices) are appropriate for DLNA control.
Instruction Scope
Runtime instructions focus on network discovery and SOAP control of MediaRenderer devices (discover, SetAVTransportURI, Play, Pause, etc.). They do not ask to read unrelated files, access unrelated environment variables, or contact third-party endpoints outside normal DLNA flows.
Install Mechanism
This is an instruction-only skill with no install spec or code files. The declared Python dependencies (async_upnp_client, httpx, click) are reasonable and proportional to the task; there is no arbitrary download or extract step.
Credentials
No environment variables, credentials, or config paths are requested. The skill's need for local network access (SSDP/UDP 1900 and HTTP to devices) is expected for DLNA control.
Persistence & Privilege
Skill does not request persistent/always-on privileges and is user-invocable only. It does not modify other skills or system-wide configs.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install dlna - 安装完成后,直接呼叫该 Skill 的名称或使用
/dlna触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
init commit
元数据
常见问题
find and control DLNA devices 是什么?
Use when controlling DLNA/UPnP media renderers (smart TVs, speakers) on a local network - discovering devices, playing media URLs, controlling playback (play... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 79 次。
如何安装 find and control DLNA devices?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install dlna」即可一键安装,无需额外配置。
find and control DLNA devices 是免费的吗?
是的,find and control DLNA devices 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
find and control DLNA devices 支持哪些平台?
find and control DLNA devices 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 find and control DLNA devices?
由 dxs(@dxsdyhm)开发并维护,当前版本 v1.0.0。
推荐 Skills