diff --git a/pirokit b/pirokit index c2b3249..d42fe24 100755 --- a/pirokit +++ b/pirokit @@ -28,6 +28,8 @@ esac page=1 while true; do + + # get the page html curl -s $url/$page/ -o tmp.html #get titles @@ -45,7 +47,6 @@ while true; do awk '{print NR " - "$0""}' titles.bw > titlesNumbered.bw # prepend next and previous - [ "$page" == "1" ] && printf '%s\n' "next" >> titlesNumbered.bw || \ printf '%s\n%s' "next" "previous" >> titlesNumbered.bw @@ -53,11 +54,11 @@ while true; do LINE=$(paste -d\| titlesNumbered.bw seeders.bw leechers.bw sizes.bw | \ sed 's/|||//' | dmenu -i -l 25 | cut -d- -f1) - [ "$LINE" == "next" ] && let "page+=1" + [ "$LINE" == "next" ] && let "page+=1" && continue - [ "$LINE" == "previous" ] && let "page-=1" + [ "$LINE" == "previous" ] && let "page-=1" && continue - [ -z "$LINE" ] && exit + [ -z "$LINE" ] && exit || break done suburl=$(sed "${LINE}q;d" links.bw)