That was a good idea but not good enough :P. At least for awesome people like me doing work manually is too mainstream xD.
If you do all the work what is your computer there for???
So I wrote a script which automatically manages the log. And next time when I run the script it will continue from the place I stopped last time \m/. Now I am planning to start Game of Thrones TV series. People tell I'll like it because I am a big fan of Age of Empires and I love wars :D.
Setup
#!/bin/bash | |
# log is 1:2 | |
echo -n "how many episodes u wanna see: " | |
read count | |
while [ $count -ne 0 ] | |
do | |
log=`cat log` | |
expr "$log" : "\(.*\):.*" | |
series=`expr "$log" : "\(.*\):.*"` | |
episode=`expr "$log" : ".*:\(.*\)"` | |
if [ `echo "$series<10"|bc` -ne 0 ] | |
then | |
series=0$series | |
fi | |
if [ `echo "$episode<10"|bc` -ne 0 ] | |
then | |
episode=0$episode | |
fi | |
file=S"$series"E"$episode" | |
file=`find . -name "*$file*"` | |
#if file exists then play else go to next series | |
if [ "$file" ] | |
then | |
# vlc is run in full screen. If u r not using vlc change this line | |
vlc -f "$file" | |
count=`expr $count - 1` | |
series=`expr "$log" : "\(.*\):.*"` | |
episode=`expr "$log" : ".*:\(.*\)"` | |
episode=`expr $episode + 1` | |
echo "$series:$episode">log | |
echo "none">error.log | |
else | |
error_log=`cat error.log` | |
if [ "$error_log" == "error" ] | |
then | |
# this will just print a fancy message :P change it if u want | |
figlet end of episodes | |
exit | |
fi | |
echo "error">error.log | |
series=`expr "$log" : "\(.*\):.*"` | |
series=`expr $series + 1` | |
echo "$series:1">log | |
fi | |
done |
Step1
Step2
Running:
Now just enter the number of episodes you want to watch in a stretch and enjoy!