X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fwatch.sh;h=cfa543723f289e1d1f6fe0a1ef29c36a0e10fbe8;hb=ac2be5f4d78b67253b5b412b73f92d6a64405b32;hp=58c1e1b42858f04ec797b013e89bed731465d9a6;hpb=e542e0a34e796df05efa42cdb091ba4032836bdd;p=serve0 diff --git a/actions/watch.sh b/actions/watch.sh index 58c1e1b..cfa5437 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -28,11 +28,11 @@ linkinfo="$(urlsafe "$info")" if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then [ -e "${_DATA}/videos/${info%.*}.mp4" ] || ln -s "${_DATA}/videos/$info" "${_DATA}/mp4/${info%.*}.mp4" videourl="$(urlsafe "mp4/${info%.*}.mp4")" -elif [ -z "$info" ]; then - videourl="$(urlsafe "${location#/}")" -else [ -z "$foreign" ];then +elif [ -n "$foreign" ]; then _COOKIE[watch]=server videourl="${_GET[url]}" +elif [ -z "$info" ]; then + videourl="$(urlsafe "${location#/}")" else videourl="$(urlsafe "videos/$info")" fi @@ -40,7 +40,7 @@ fi case "$_COOKIE[watch]" in raspi) rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url=" - redirect "${rpiaddr}$(urlsafe "http://jupiter:8000/${videourl}")" + redirect "${rpiaddr}$(urlsafe "http://${HTTP_HOST}/${videourl}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \ @@ -56,6 +56,7 @@ case "$_COOKIE[watch]" in server) [ -n "$location" ] && playuri="${treeroot%/}/${location#/}" [ -n "$info" ] && playuri="${_DATA}/videos/$info" + [ -n "$foreign" ] && playuri="$videourl" metafile="${_DATA}/meta/${info}.meta"