sh [Plex CLI]一个简单的bash脚本来控制您的Plex客户端#plex #cli #shell

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh [Plex CLI]一个简单的bash脚本来控制您的Plex客户端#plex #cli #shell相关的知识,希望对你有一定的参考价值。

#!/bin/bash
###  $0 is a simple bash script to control your Plex client
###
###  Usage: plex [<command>]
###
###  Available commands:
###   up            Navigate up
###   down          Navigate down
###   left          Navigate left
###   right         Navigate right
###   back          Navigate back
###   menu          Open menu
###   select        Select current option
###   rewind        Rewind the playback 
###   bigrewind     Rewind the playback more
###   forward       Rewind the playback 
###   bigforward    Rewind the playback more
###   play          Playback play
###   stop          Playback stop
###   osd           Toggle OSD
###
###  Examples:
###    plex play
###    plex pause
###    plex stop
###

# The IP of the Plex Media Server
SERVER=127.0.0.1

# The IP address of the Plex client that you wish to control
CLIENT=192.168.1.123 

case $1 in
    up)
        COMMAND="navigation/moveUp" 
        ;;
    down)
        COMMAND="navigation/moveDown" 
        ;;
    left)
        COMMAND="navigation/moveLeft" 
        ;;
    right)
        COMMAND="navigation/moveRight" 
        ;;
    select)
        COMMAND="navigation/select" 
        ;;
    menu)
        COMMAND="navigation/contextMenu" 
        ;;
    back)
        COMMAND="navigation/back" 
        ;;
    bigrewind)
        COMMAND="playback/bigStepBack" 
        ;;
    rewind)
        COMMAND="playback/stepBack" 
        ;;
    play)
        COMMAND="playback/play" 
        ;;
    stop)
        COMMAND="navigation/stop" 
        ;;
    forward)
        COMMAND="playback/stepForward" 
        ;;
    bigforward)
        COMMAND="playback/bigStepForward" 
        ;;
    osd)
        COMMAND="navigation/toggleOSD" 
        ;;
    *)
        echo "Unknown command $1"
        grep "^###" $0 | sed -e 's/^###//'
        exit 1
        ;;
esac

URL="http://${SERVER}:32400/system/players/${CLIENT}/${COMMAND}"
wget $URL 2>/dev/null || curl -O $URL

以上是关于sh [Plex CLI]一个简单的bash脚本来控制您的Plex客户端#plex #cli #shell的主要内容,如果未能解决你的问题,请参考以下文章

sh gjaltemba @ https://forums.plex.tv/discussion/168808/ubuntu-users-bash-script-to-install-or-updat

sh 简单的bash脚本来创建utf-8 mysql db。仅供内部使用!!!

Git Bash 中的 Azure CLI

sh 简单的bash脚本

sh [简单复制脚本]这里只是为了笔记#bash

sh 一个简单的bash脚本,用于在Unix / Linux上使用ping观察数据包丢失