From cb234a12e1c6a8fd23ad8a1528c874dcd0b25c4d Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Fri, 5 Aug 2022 13:03:42 +0200 Subject: [PATCH] Added new previous page browsing. --- pirokit | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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)