Added new previous page browsing.

This commit is contained in:
Crony Akatsuki 2022-08-05 13:03:42 +02:00
parent 3bd9eace9b
commit cb234a12e1

View File

@ -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)