]> git.plutz.net Git - serve0/blobdiff - actions/watch.sh
styling for pagination links
[serve0] / actions / watch.sh
index 4e42ed216e65ae3002217b6f6bbc3500cbf79d1c..1ba0954192943b07529c80d842b9670b3639cdf5 100755 (executable)
@@ -26,6 +26,8 @@ if [ "${_COOKIE[fakemp4]}" = yes ]; then
   if [ "$info" != "${fakename}.mp4" ]; then
     [ -e "${_DATA}/mp4/${fakename}.mp4" ] || ln -s "${_DATA}/videos/$info" "${_DATA}/mp4/${fakename}.mp4"
     videourl="$(urlsafe "mp4/${fakename}.mp4")"
+  else
+    videourl="$(urlsafe "videos/$info")"
   fi
 elif [ -n "$foreign" ]; then
   _COOKIE[watch]=server
@@ -39,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]}")"