X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fwatch.sh;h=546654c6adfcdd2b7583d615e46d2b31dab94991;hb=9554fea689ec1519a572888aae9dc37ae140cd57;hp=8d8ac3318e5aa0217f7f0dd5b4aecdef625d4324;hpb=50ca23e58b678c818c2a8bb3a345136c1366047a;p=serve0 diff --git a/actions/watch.sh b/actions/watch.sh index 8d8ac33..546654c 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -9,13 +9,9 @@ search="${_POST[s]}" filter="${_POST[f]}" page="${_POST[pn]}" -watch_link='' +watch_link="${_POST[page]}&" [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&" [ -n "$info" ] && watch_link="i=$(urlsafe "${info}")&" -[ -n "$order" ] && watch_link="${watch_link}o=${order}&" -[ -n "$search" ] && watch_link="${watch_link}s=${search}&" -[ -n "$filter" ] && watch_link="${watch_link}f=${filter}&" -[ -n "$page" ] && watch_link="${watch_link}pn=${page}" meta="${_DATA}/meta/$info.meta" head -n1 "$meta" |read length width height filename @@ -31,6 +27,7 @@ if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then elif [ -n "$foreign" ]; then _COOKIE[watch]=server videourl="${_GET[url]}" + watch_link="${_POST[return]}" elif [ -z "$info" ]; then videourl="$(urlsafe "${location#/}")" else @@ -39,8 +36,8 @@ fi case "$_COOKIE[watch]" in raspi) - rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch&url=" - redirect "${rpiaddr}$(urlsafe "http://${HTTP_HOST}/${videourl}")" + rpiaddr="http://atoemchen.helmchyn.no-ip.biz/?action=watch" + redirect "${rpiaddr}&url=$(urlsafe "http://${HTTP_HOST}/${videourl}")&return=$(urlsafe "http://${HTTP_HOST}/?${_POST[page]}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \ @@ -73,24 +70,25 @@ case "$_COOKIE[watch]" in cp "$metafile" "$playmeta" else rm "$playmeta" - "${_EXEC}"/helpers/genmeta.sh "$playuri" "$playmeta" >/dev/null + "${_EXEC}"/helpers/genmeta.sh "$playuri" "$playmeta" >&- fi export DISPLAY=":0" uid="$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')" export XDG_RUNTIME_DIR="/run/user/$uid" # required for Pulseaudio - xrandr || true >/dev/null # helps enable all screens + xrandr || true >&- # helps enable all screens + xvkbd -text '\x+10000\y+10000' || true >&- if mplayer |grep -q MPlayer2; then nohup /usr/bin/mplayer \ --slave --input=file="$fifofile" \ --volume="$volume" \ - "$playuri" 2>"$statusfile" >/dev/null & + "$playuri" 2>"$statusfile" >&- & else nohup /usr/bin/mplayer \ -slave -input file="$fifofile" \ -volume "$volume" \ - "$playuri" >"$statusfile" 2>/dev/null & + "$playuri" >"$statusfile" & fi chmod 600 "$statusfile"