12 [ -n "$info" ] && watch_link="i=$(urlsave "${info}")&"
13 [ -n "$order" ] && watch_link="${watch_link}o=${order}&"
14 [ -n "$search" ] && watch_link="${watch_link}s=${search}&"
15 [ -n "$filter" ] && watch_link="${watch_link}f=${filter}&"
16 [ -n "$page" ] && watch_link="${watch_link}pn=${page}"
18 meta="${_DATA}/meta/$info.meta"
19 head -n1 "$meta" |read length width height filename
20 [ "$length" -gt 0 ] || length=0
21 [ "$width" -gt 0 ] || width=0
22 [ "$height" -gt 0 ] || height=0
24 linkinfo="$(urlsave "$info")"
26 if [ "${_COOKIE[fakemp4]}" = yes ] && [ "${info##*.}" != mp4 ]; then
27 [ -e "${_DATA}/videos/${info%.*}.mp4" ] || ln -s "${_DATA}/videos/$info" "${_DATA}/mp4/${info%.*}.mp4"
28 videourl="$(urlsave "mp4/${info%.*}.mp4")"
30 videourl="$(urlsave "videos/$info")"
33 case "${_COOKIE[watch]}" in
35 rpiaddr="http://pfostenpanne.helmchyn.no-ip.biz/?player=play&path="
36 [ $height -gt 480 -a $width -gt 480 ] && redirect "${rpiaddr}$(urlsave "http://jupiter:8000/?action=transcode&i=${linkinfo}&t=480")" \
37 || redirect "${rpiaddr}$(urlsave "http://jupiter:8000/${videourl}")"
40 [ $height -gt 480 ] && redirect "?action=transcode&i=${linkinfo}&t=480" \
41 || redirect "$videourl"
44 [ $height -gt 240 ] && redirect "?action=transcode&i=${linkinfo}&t=240" \
45 || redirect "$videourl"
51 DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1006 nohup /usr/bin/mplayer -ao pulse --quiet "${_DATA}/videos/$info" >/dev/null 2>/dev/null &
52 redirect "$HTTP_REFERER"
54 *) redirect "?p=view&${watch_link}"