#!/usr/bin/env sh if [ -z "$1" ]; then echo 'Wrong usage' echo 'Do not run this file directly' exit 1 fi [ -e 'input.html' ] && rm 'input.html' [ -e 'output.html' ] && rm 'output.html' HTML_START="$(cat 'res/html_start')" HTML_SEARCH='
' HTML_TOGGLER='' HTML_END="$(cat 'res/html_end')" HTML_STYLE="$(cat 'res/css.css')" HTML_VIDEO='' wget "https://www.xvideos.com$1" -O 'input.html' echo "$1" | grep '^/video' if [ $? = 0 ]; then str="$(grep 'video_related=' 'input.html' | sed 's/,/\n/g')" video="$(grep 'setVideoUrlHigh' 'input.html' | cut -d"'" -f2)" video_low="$(grep 'setVideoUrlLow' 'input.html' | cut -d"'" -f2)" if [ -z "$video" ]; then video="$video_low" fi grep 'video-hd-mark' 'input.html' if [ "$?" -eq 0 ]; then video_hls="$(grep 'setVideoHLS' 'input.html' | cut -d"'" -f2)" else video_hls='' fi video_thumb="$(grep 'setThumbUrl' 'input.html' | cut -d"'" -f2 | sed 1q)" thumbs="$(echo "$str" | grep '"i":' | sed 's/\\//g' | sed 's/"i"://g' | sed 's/"//g')" urls="$(echo "$str" | grep '"u":' | sed 's/\\//g' | sed 's/"u"://g' | sed 's/"//g')" HTML_VIDEO="