360 Secure SkillHub
360 安全技能中心

Plex Server

核心功能包括通过HTTP API管理Plex媒体服务器,如搜索资源、刷新媒体库、查看活跃流、检查更新等;可选通过ADB管理英伟达Shield设备,实现重启、查看设备健康、重启Plex应用等操作。典型场景为个人媒体库运维、Shield设备远程管理。通过CLI命令输入,输出支持JSON或适配社交平台的格式化文本,需先配置Plex令牌完成初始化,支持多服务器选择。

grewingm
grewingm
热度 18.31
最近更新 2026-07-01 13:14:09
分类:自动化依赖:代码执行 / 第三方 API应用场景:自动化脚本 / 任务管理 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add plex-server
Metadata
name
Plex Server
description
Manage Plex Media Server with optional Nvidia Shield ADB device management.
allowed-tools
["exec"]
user-invocable
true

Plex Media Server Manager

Primary focus: Plex Media Server management via HTTP API. Optional: Nvidia Shield device management via ADB.

Onboarding

Step 1: Get your Plex token

  1. Open Plex Web (app.plex.tv), play any media
  2. Click "⋯" → "Get Info" → "View XML"
  3. In the URL, find X-Plex-Token=... — that's your token

Step 2: Discover your servers

node scripts/shield-cli.js discover <plex_token>

Lists all Plex servers on your account with name, version, platform, and local URL.

Step 3: Configure

# Plex only (auto-discovers first server)
node scripts/shield-cli.js setup <plex_token>

# Pick a specific server (if you have multiple)
node scripts/shield-cli.js setup <plex_token> 0    # first server
node scripts/shield-cli.js setup <plex_token> 1    # second server

# Plex + Shield ADB
node scripts/shield-cli.js setup <plex_token> 0 192.168.70.2

No username/password needed — the Plex token is the universal key. The script calls plex.tv/api/resources to auto-discover IP and port.

Config stored at ~/.openclaw/shield/config.json (chmod 600).

Commands

Plex (no ADB needed)

Command Args Notes
discover <token> List all Plex servers on account
setup <token> [idx] [shield_ip] Auto-discover + configure
plex-status — Server version, platform
search <query> Search with full metadata
format — Pipe search JSON → readable text
sessions — Active streams
libraries — Library sections with IDs
scan <section_id> Refresh a library
recently-added — Last 20 additions
updater-status — Plex update availability
health — Plex status + sessions (+ ADB if configured)

Shield ADB (requires shield_ip)

Command Notes
connect ADB connect
adb-health Uptime, memory, disk, battery
reboot Reboot Shield
restart-plex Force stop + start Plex app

Search + Format Pipeline

node scripts/shield-cli.js search "query" | node scripts/shield-cli.js format

Produces channel-agnostic formatted output with emoji, suitable for Discord, WhatsApp, Telegram, etc.

Search Output Fields

  • Basic: title, year, type, source (local/streaming), library, summary
  • Genres: genre tags from Plex metadata
  • Quality: resolution (4k/1080p/720p), video codec, bitrate, container, file size
  • Audio: codec, channels, language per track
  • Subtitles: codec, language per track
  • Meta: duration, studio, content rating, view count

Gotchas

  • Plex token = full server admin access. Config file is chmod 600.
  • No login/password needed — the token is the universal key for all Plex API calls.
  • Multiple servers? Use discover to list them, then setup <token> <index> to pick.
  • Shield on Wi-Fi may change IP. Use DHCP reservation for ADB.
  • Always pipe search through format for user-facing output.
  • ADB features are optional — Plex-only setup works without Shield/ADB.