X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fwatch.sh;h=596ca32ad43c96bcd7d4c26410d2369f9b57ad34;hb=ddb7aec7f13135a201d99cf931d2eb88732816be;hp=5aff94559b1c65d7e32759572d8a7110e711dbda;hpb=94b22476b017682875212d6c569b221056dd7bb7;p=serve0 diff --git a/actions/watch.sh b/actions/watch.sh index 5aff945..596ca32 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -21,9 +21,14 @@ head -n1 "$meta" |read length width height filename 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")" +if [ "${_COOKIE[fakemp4]}" = yes ]; then + fakename="$(printf %s "${info}" |sed -r 's;.*/;;g; s;.[^.]+$;;; s;\.;_;g;')" + 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 videourl="${_GET[url]}" @@ -36,8 +41,14 @@ 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]}")" + #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 + GET /?action=watch&url=$(urlsafe "http://${HTTP_HOST}/${videourl}") HTTP/1.1$(printf \\r) + Host: atoemchen$(printf \\r) + $(printf \\r) + EOF + redirect "?p=playctl&${watch_link}w=$(urlsafe "${_POST[page]}#${_GET[i]}")" ;; 480p) [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \