This commit is contained in:
CronyAkatsuki 2023-02-23 16:39:26 +01:00
parent 5fbb987ca5
commit c4f8284194

View File

@ -38,13 +38,13 @@ while true; do
grep -o '<a href="/view/.*">' tmp.html | sed -n 's/.*title="\([^"]*\).*/\1/p' | grep -v 'comment.*' > titles.bw grep -o '<a href="/view/.*">' tmp.html | sed -n 's/.*title="\([^"]*\).*/\1/p' | grep -v 'comment.*' > titles.bw
# get sizes # get sizes
pup 'td.text-center text{}' -f tmp.html | awk -v RS='' '{print $1, $2}' | sed -r '/^\s*$/d' > sizes.bw pup 'td.text-center text{}' -f tmp.html | sed '/^[[:blank:]]*$/d' | sed -n '1~5p' > sizes.bw
# get seeders # get seeders
pup 'td.text-center text{}' -f tmp.html | awk -v RS='' '{print $5}' | sed -r '/^\s*$/d' > seeders.bw pup 'td.text-center text{}' -f tmp.html | sed '/^[[:blank:]]*$/d' | sed -n '3~5p' > seeders.bw
# get leechers # get leechers
pup 'td.text-center text{}' -f tmp.html | awk -v RS='' '{print $6}' | sed -r '/^\s*$/d' > leechers.bw pup 'td.text-center text{}' -f tmp.html | sed '/^[[:blank:]]*$/d' | sed -n '4~5p' > leechers.bw
# generate line numbers # generate line numbers
awk '{print NR " - "$0""}' titles.bw > titlesNumbered.bw awk '{print NR " - "$0""}' titles.bw > titlesNumbered.bw
@ -55,7 +55,7 @@ while true; do
#gets line number (that groupthe user selected in dmenu) #gets line number (that groupthe user selected in dmenu)
LINE=$(paste -d\| titlesNumbered.bw seeders.bw leechers.bw sizes.bw | \ LINE=$(paste -d\| titlesNumbered.bw seeders.bw leechers.bw sizes.bw | \
sed 's/|||//' | dmenu -i -l 25 | cut -d- -f1) sed 's/|||//' | column -t -s '|' | dmenu -i -l 25 | cut -d- -f1)
[ "$LINE" = "next" ] && let "page+=1" && continue [ "$LINE" = "next" ] && let "page+=1" && continue