mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
reverted to old laptop
This commit is contained in:
13
torrent
13
torrent
@@ -9,32 +9,27 @@ c_reset="\033[0m"
|
||||
down(){
|
||||
tput reset
|
||||
notify-send "Torrent: Downloading"
|
||||
aria2c -d $2 --select-file=$3 --seed-time=0 $1 && notify-send "Torrent: Download complete" && rm -f $file || notify-send -u critical "Torrent: Error!!"
|
||||
aria2c -d movies --select-file=$2 --seed-time=0 $1 && notify-send "Torrent: Download complete" && rm -f $file || notify-send -u critical "Torrent: Error!!"
|
||||
}
|
||||
|
||||
trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP
|
||||
|
||||
if [ -z "$*" ]; then
|
||||
magnet=$(xclip -out clipboard)
|
||||
else
|
||||
magnet=$*
|
||||
fi
|
||||
[ -z "$*" ] && magnet=$(xclip -out clipboard) || magnet=$*
|
||||
|
||||
echo "$magnet"
|
||||
x=$(printf "MOVIES\nSoftwares" | dmenu -p "Select Directory :" | tr -d '\n')
|
||||
printf "${c_yellow}Download>>\n${c_green}[f]ull torrent\n${c_cyan}[p]artial torrent \n${c_red}[q]uit"
|
||||
printf "${c_reset}\n\tenter choice:"
|
||||
read -r ch
|
||||
case $ch in
|
||||
f)
|
||||
down "$magnet" "$x";;
|
||||
down "$magnet";;
|
||||
p)
|
||||
aria2c --dir=$HOME/.cache --bt-metadata-only=true --bt-save-metadata=true "$magnet"
|
||||
tput reset
|
||||
aria2c --show-files=true $HOME/.cache/*.torrent
|
||||
printf "Enter file idx(default=all):"
|
||||
read -r ind
|
||||
down "$HOME/.cache/*.torrent" "$x" "$ind"
|
||||
down "$HOME/.cache/*.torrent" "$ind"
|
||||
rm -f $HOME/.cache/*.torrent;;
|
||||
q)
|
||||
break;;
|
||||
|
||||
Reference in New Issue
Block a user