]> git.plutz.net Git - serve0/commitdiff
extending cooperation functions
authorpaul <paul@plutz.net>
Mon, 28 Nov 2016 20:28:39 +0000 (20:28 +0000)
committerpaul <paul@plutz.net>
Mon, 28 Nov 2016 20:28:39 +0000 (20:28 +0000)
svn path=/trunk/; revision=158

actions/watch.sh

index cc47088c0bebc5e73c1b13895a307db1dd51e896..58c1e1b42858f04ec797b013e89bed731465d9a6 100755 (executable)
@@ -2,8 +2,8 @@
 
 cgi_refdata
 info="${_GET[i]}"
-watch="${_GET[w]:-${_COOKIE[watch]}}"
 location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)"
+foreign="$(validate "${_GET[url]}" 'https?://.*' '')"
 order="${_POST[o]}"
 search="${_POST[s]}"
 filter="${_POST[f]}"
@@ -30,13 +30,16 @@ if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then
   videourl="$(urlsafe "mp4/${info%.*}.mp4")"
 elif [ -z "$info" ]; then
   videourl="$(urlsafe "${location#/}")"
+else [ -z "$foreign" ];then
+  _COOKIE[watch]=server
+  videourl="${_GET[url]}"
 else
   videourl="$(urlsafe "videos/$info")"
 fi
 
-case "$watch" in
+case "$_COOKIE[watch]" in
   raspi)
-    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&w=server&i="
+    rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url="
     redirect "${rpiaddr}$(urlsafe "http://jupiter:8000/${videourl}")"
   ;;
   480p)