mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
debug line test
This commit is contained in:
21
tor-bay
21
tor-bay
@@ -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-)
|
||||
|
||||
Reference in New Issue
Block a user