From: paul Date: Sun, 10 Dec 2017 00:45:29 +0000 (+0000) Subject: set up remote player in local.opts X-Git-Url: http://git.plutz.net/?p=serve0;a=commitdiff_plain;h=5b144c02682c833344dbe71c55b7dc53f63ef45d set up remote player in local.opts svn path=/trunk/; revision=194 --- diff --git a/actions/watch.sh b/actions/watch.sh index 596ca32..1ba0954 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -41,11 +41,9 @@ fi case "$_COOKIE[watch]" in raspi) - #rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch" - #redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/${_POST[page]}")" - ncat atoemchen 80 >&- <<-EOF + ncat "$RHOST" "$RPORT" >&- <<-EOF GET /?action=watch&url=$(urlsafe "http://${HTTP_HOST}/${videourl}") HTTP/1.1$(printf \\r) - Host: atoemchen$(printf \\r) + Host: ${RHOST}$(printf \\r) $(printf \\r) EOF redirect "?p=playctl&${watch_link}w=$(urlsafe "${_POST[page]}#${_GET[i]}")" diff --git a/globals.sh b/globals.sh index b68a8c9..402cba2 100755 --- a/globals.sh +++ b/globals.sh @@ -1,6 +1,6 @@ #!/bin/zsh -# Copyright 2014,2015 Paul Hänsch +# Copyright 2014 - 2017 Paul Hänsch # # This file is part of Serve0. # @@ -30,3 +30,6 @@ _GET[pn]=$(validate "${_GET[pn]}" '[1-9][0-9]*' 1) cgi_cookie _COOKIE[pagesize]=$(validate "${_COOKIE[pagesize]}" '[1-9][0-9]*' 50) + +[ -z "$RHOST" ] && RHOST=localhost +[ -z "$RPORT" ] && RPORT=80 diff --git a/pages/playctl.sh b/pages/playctl.sh index 3636351..f8247e0 100755 --- a/pages/playctl.sh +++ b/pages/playctl.sh @@ -44,10 +44,10 @@ head -n1 "$meta" |read length width height TITLE debug VIDEO: $video if [ "$_COOKIE[watch]" = raspi ]; then - actionuri='//atoemchen/?action=playctl' - volume="$({ncat atoemchen 80 <<-EOF + actionuri="//${RHOST}:${RPORT}/?action=playctl" + volume="$({ncat "$RHOST" "$RPORT" <<-EOF GET /?action=playctl&api=volume HTTP/1.0${CR} - Host: atoemchen${CR} + Host: ${RHOST}${CR} ${CR} EOF } | sed -r '1,/^\r$/d')" @@ -71,9 +71,9 @@ printf 'Refresh: 1\r\n' progress(){ if [ "$_COOKIE[watch]" = raspi ]; then - { ncat atoemchen 80 <<-EOF + { ncat "$RHOST" "$RPORT" <<-EOF GET /?action=playctl&api=progress HTTP/1.0${CR} - Host: atoemchen${CR} + Host: ${RHOST}${CR} ${CR} EOF } | sed -ur '1,/^\r$/d'