debug line test

This commit is contained in:
coolnsx
2024-06-02 20:06:46 +05:30
parent f0952fb659
commit 7912ce57bc
9 changed files with 23 additions and 145 deletions

21
tor-bay
View File

@@ -6,31 +6,24 @@ cal_size() {
}
display() {
for i in $(seq $(printf "%s\nlol" "$2" | wc -l)); do
for i in $(seq "$(printf "%s\nlol" "$2" | wc -l)"); do
printf "[%s GB;S:%s\n" "$(cal_size "$(printf "%s" "$1" | sed -n "${i}p")")" "$(printf "%s" "$2" | sed -n "${i}p")" &
done
wait
}
case $(uname -o) in
*ndroid*)
os="droid"
script_dir="$HOME/.shortcuts"
;;
*)
os="linux"
script_dir="$HOME/repos_scripts"
;;
esac
os="linux"
uname -o | grep -q "ndroid" && os="droid"
. $script_dir/.functions
# shellcheck disable=SC1091,SC1090
. "$(dirname "$0")"/.functions
[ -z "$*" ] && search_$os "Search Torrent: " || query=$*
[ -z "$query" ] && exit 0
[ "$os" = "linux" ] && tmp=$(notify-send -e "Searching query" -p)
query=$(printf "%s" "$query" | tr " " "+")
data=$(curl -s "https://apibay.org/q.php?q=$query" | tee data | sed 's/},/}\n/g' | tr -d "[]")
data=$(curl -s "https://apibay.org/q.php?q=$query" | sed 's/},/}\n/g' | tr -d "[]")
[ "$os" = "linux" ] && notify-send -e "tidying up data" -r $tmp
[ "$os" = "linux" ] && notify-send -e "tidying up data" -r "$tmp"
size=$(printf "%s" "$data" | sed -nE 's/.*name.*size":"(.*)",.*user.*/\1/p')
name_seed=$(printf "%s" "$data" | sed -nE 's/.*name":"(.*)","info_hash.*seeders":"(.*)",.*num.*/\2] \1/p')
sel=$(display "$size" "$name_seed" | menu_$os "Select Torrent: " | cut -d" " -f3-)