125 lines
3.6 KiB
Plaintext
125 lines
3.6 KiB
Plaintext
|
#!/bin/bash
|
||
|
|
||
|
headOut()
|
||
|
{
|
||
|
animeIn=$(echo "$QUERY_STRING" | sed -n 's/^.*anime=\([^&]*\).*$/\1/p')
|
||
|
touch ../tmp/tmpShow ../tmp/animeShow ../tmp/tmpVdoPg
|
||
|
wget http://www.theanimenetwork.com/Watch-Anime/"${animeIn}" -O ../tmp/tmpShow
|
||
|
sed 1,195d ../tmp/tmpShow > ../tmp/animeShow
|
||
|
|
||
|
IFS=$'\n'
|
||
|
bgs=($(ls -L ../backgrounds/))
|
||
|
numdirs=${#bgs[@]}
|
||
|
index=$(( (( RANDOM % $numdirs ) - 2) + 1 ))
|
||
|
|
||
|
if [ -f ./000.jpg ]; then
|
||
|
bg="<div id="bg"><img src="./000.jpg"/></div>";
|
||
|
else
|
||
|
bg="<div id="bg"><img src="\"../backgrounds/${bgs[index]}"\"/></div>";
|
||
|
fi
|
||
|
echo '<!doctype html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<title>MiniRoll App</title>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<link rel="stylesheet" href="../themes/bodyCss.css" type="text/css">
|
||
|
<link rel="stylesheet" href="../themes/menuCss.css" type="text/css">
|
||
|
</head>
|
||
|
<body>
|
||
|
'${bg}'
|
||
|
<center>
|
||
|
<ul><a href="../index.html"><li>Home</li></a>
|
||
|
<li>
|
||
|
Layout
|
||
|
<ul>
|
||
|
<a href="../cgi-bin/listOnLeftTheme.cgi"><li>List On The Left</li></a>
|
||
|
<a href="../cgi-bin/gridTheme.cgi"><li>Grid</li></a>
|
||
|
<a href="../cgi-bin/centerList.cgi"><li>List Centered</li></a>
|
||
|
</ul>
|
||
|
</li>
|
||
|
<li>About</li>
|
||
|
<a href="#" onclick="location.reload(true); return false;"><li>Refresh</li></a>
|
||
|
<a href="../cgi-bin/quit.cgi"><li>Quit</li></a>
|
||
|
</ul>
|
||
|
</center>
|
||
|
<br>
|
||
|
' > ../tmp/list.html
|
||
|
main
|
||
|
}
|
||
|
main()
|
||
|
{
|
||
|
sed -n 's/.*title="\([^"]*\).*/\1/p' ../tmp/animeShow > ../tmp/tmptitles
|
||
|
sed -i '/Spoilers!!!/d' ../tmp/tmptitles
|
||
|
sed -i '/You must be a premium subscriber to watch this video./d' ../tmp/tmptitles
|
||
|
sed -i '/The Add To Queue feature is available to premium subscribers./d' ../tmp/tmptitles
|
||
|
sed -i '/^\s*$/d' ../tmp/tmptitles
|
||
|
awk 'NR%2==1' ../tmp/tmptitles > ../tmp/titles
|
||
|
|
||
|
sed -n 's/.*src="\([^"]*\).*/\1/p' ../tmp/animeShow > ../tmp/imgList
|
||
|
awk 'NR%2==1' ../tmp/imgList > ../tmp/tmpImgList
|
||
|
head -n -3 ../tmp/tmpImgList > ../tmp/imgList
|
||
|
|
||
|
sed -n 's/.*href="\([^"]*\).*/\1/p' ../tmp/animeShow > ../tmp/mediaIds
|
||
|
sed -i '/\/xx/d' ../tmp/mediaIds
|
||
|
awk 'NR%2==1' ../tmp/mediaIds > ../tmp/tmpIds
|
||
|
head -n -3 ../tmp/tmpIds > ../tmp/mediaIds
|
||
|
|
||
|
d=$(cat ../tmp/mediaIds | wc -l) >> /dev/null ;
|
||
|
i="1"
|
||
|
# World-God-Only-Knows-The-Season-1
|
||
|
# Log-Horizon
|
||
|
echo "" > ../tmp/tmpIds
|
||
|
echo "" > ../tmp/tmpIds2
|
||
|
|
||
|
while [ $i -le $d ]; do
|
||
|
meiaID=$(sed -n "${i}p" ../tmp/mediaIds);
|
||
|
wget http://www.theanimenetwork.com"${meiaID}" -O ../tmp/tmpVdoPg
|
||
|
sed -n 146,152p ../tmp/tmpVdoPg > ../tmp/tmpIds
|
||
|
sed -n 's/.*src="\([^"]*\).*/\1/p' ../tmp/tmpIds >> ../tmp/tmpIds2
|
||
|
i=$[$i++1];
|
||
|
done
|
||
|
sed -i '/^\s*$/d' ../tmp/tmpIds2
|
||
|
cat ../tmp/tmpIds2 > ../tmp/mediaIds
|
||
|
i="1"
|
||
|
|
||
|
while [ $i -le $d ]; do
|
||
|
title=$(sed -n "${i}p" ../tmp/titles);
|
||
|
imgLnk=$(sed -n "${i}p" ../tmp/imgList)
|
||
|
meiaID=$(sed -n "${i}p" ../tmp/mediaIds);
|
||
|
vdoLnk=""$meiaID""
|
||
|
echo '
|
||
|
<div class="lnksNdirs">
|
||
|
<a target="frame" href="'${vdoLnk}'" style="color:#00E8FF;">
|
||
|
<img src="'${imgLnk}'" /> <br>
|
||
|
'${title}'</a>
|
||
|
</div>' >> ../tmp/list.html ;
|
||
|
i=$[$i++1];
|
||
|
done
|
||
|
endOut
|
||
|
}
|
||
|
endOut()
|
||
|
{
|
||
|
echo '
|
||
|
<iframe id="frame" name="frame" frameborder="0" class="iframer"></iframe>
|
||
|
<iframe sandbox id="invisFrame" name="invisFrame" frameborder="0"></iframe>
|
||
|
</body>
|
||
|
</html>' >> ../tmp/list.html
|
||
|
redirect
|
||
|
}
|
||
|
redirect()
|
||
|
{
|
||
|
echo "Content-type: text/html"
|
||
|
echo ""
|
||
|
echo "<html>"
|
||
|
echo "<head>"
|
||
|
echo "<title>Loading...</title>"
|
||
|
echo "<meta http-equiv='refresh' content='1;URL=../tmp/list.html'>"
|
||
|
echo "</head>"
|
||
|
echo "<body style='background-color:#000000'>"
|
||
|
echo "<center><font color='#FFFFFF'>You will be redirected in a few seconds...</font></center>"
|
||
|
echo "<img style='width:30em;height:30em;margin-left:50%;margin-top:15%;' src='../icons/loading.gif'></img>"
|
||
|
echo "</body>"
|
||
|
echo "</html>"
|
||
|
}
|
||
|
headOut
|