diff --git a/ani-cli b/ani-cli index 97f722a..3b5b213 100755 --- a/ani-cli +++ b/ani-cli @@ -145,15 +145,6 @@ anime_selection () { ## Ep selection ## ################## -episode_selection () { - [ $is_download -eq 1 ] && - printf "Range of episodes can be specified: start_number end_number\n" - - printf "${c_blue}Choose episode $c_cyan[1-%d]$c_reset:$c_green " $last_ep_number - read ep_choice_start ep_choice_end - printf "$c_reset" -} - open_episode () { anime_id=$1 episode=$2 @@ -174,7 +165,8 @@ open_episode () { if [ $is_download -eq 0 ]; then if [ $is_cast -eq 0 ]; then - setsid -f $player_fn --http-header-fields="Referer: $embedded_url" "$video_url" >/dev/null 2>&1 + ([ -z $ep_choice_end ] && + setsid -f $player_fn --referrer="$embedded_url" "$video_url" >/dev/null 2>&1 || $player_fn --referrer="$embedded_url" "$video_url" >/dev/null 2>&1) else catt cast "$video_url" fi @@ -183,8 +175,7 @@ open_episode () { # add 0 padding to the episode name episode=$(printf "%03d" $episode) { - # aria2c -x 16 -s 16 --referer "$embedded_url" "$video_url" --dir=MOVIES -o "${anime_id}-${episode}.mp4" && - aria2c --referer "$embedded_url" "$video_url" --dir=MOVIES -o "${anime_id}-${episode}.mp4" && + aria2c -x 16 -s 16 --referer "$embedded_url" "$video_url" --dir=MOVIES -o "${anime_id}-${episode}.mp4" && printf "${c_green}Downloaded episode: %s${c_reset}\n" "$episode" || printf "${c_red}Download failed episode: %s${c_reset}\n" "$episode" } @@ -225,7 +216,10 @@ get_search_query "$*" search_results=$(search_anime "$query") [ -z "$search_results" ] && die "No search results found" anime_selection "$search_results" -episode_selection +[ $is_download -eq 1 ] && printf "Range of episodes can be specified: start_number end_number\n" +printf "${c_blue}Choose episode $c_cyan[1-%d]$c_reset:$c_green " $last_ep_number +read ep_choice_start ep_choice_end +printf "$c_reset" { # checking input [ "$ep_choice_start" -eq "$ep_choice_start" ] 2>/dev/null || die "Invalid number entered" @@ -280,7 +274,7 @@ while :; do break;; *) - die "invalid choice" + err "invalid choice" ;; esac diff --git a/st-0.8.4/config.def.h b/st-0.8.4/config.def.h index 8b90b1a..2835120 100644 --- a/st-0.8.4/config.def.h +++ b/st-0.8.4/config.def.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "JetBrains Mono:style=Bold:pixelsize=18:antialias=true:autohint=true"; +static char *font = "JetBrains Mono NL:style=Regular:pixelsize=18:antialias=true:autohint=true"; static int borderpx = 0; diff --git a/st-0.8.4/st b/st-0.8.4/st index 27ff01c..6e87215 100755 Binary files a/st-0.8.4/st and b/st-0.8.4/st differ diff --git a/st-0.8.4/x.o b/st-0.8.4/x.o index 0cdeb4c..b30e4f6 100644 Binary files a/st-0.8.4/x.o and b/st-0.8.4/x.o differ diff --git a/tor-cli b/tor-cli index 4abc511..501c43d 100755 --- a/tor-cli +++ b/tor-cli @@ -59,7 +59,7 @@ fullURL="${baseurl}${url}/" curl -s $fullURL -o $cachedir/tmp.html magnet=$(grep -Po "magnet.*\" " $cachedir/tmp.html | tr -d \") -echo $magnet > .cache/maglink +echo $magnet > $HOME/.cache/maglink st -e $HOME/repos_scripts/torrent "$magnet" & diff --git a/torrent b/torrent index 5e624cb..c365b38 100755 --- a/torrent +++ b/torrent @@ -1,34 +1,52 @@ #!/bin/sh +c_red="\033[1;31m" +c_green="\033[1;32m" +c_yellow="\033[1;33m" +c_blue="\033[1;34m" +c_magenta="\033[1;35m" +c_cyan="\033[1;36m" +c_reset="\033[0m" + full_tor(){ + tput reset notify-send "Torrent:Rukk ja cheecha Download ho rha hai" - aria2c -d $2 --seed-time=0 "$1" && notify-send "Torrent:cheecha download hogyi" || notify-send -u critical "Torrent:cheecha error!!" + aria2c -d $2 --seed-time=0 "$1" && notify-send "Torrent:cheecha download hogyi" && rm -f $file || notify-send -u critical "Torrent:cheecha error!!" } part_tor(){ aria2c --dir=$HOME/.cache --bt-metadata-only=true --bt-save-metadata=true "$1" + tput reset aria2c --show-files=true $HOME/.cache/*.torrent - printf "Enter index of the file to download:" + printf "Enter file idx(default=all):" read -r ind + tput reset notify-send "Torrent:Rukk ja cheecha Download ho rha hai" - aria2c --select-file=$ind -d $2 --seed-time=0 $HOME/.cache/*.torrent && notify-send "Torrent:cheecha download hogyi" || notify-send -u critical "Torrent:cheecha error!!" + aria2c --select-file=$ind -d $2 --seed-time=0 $HOME/.cache/*.torrent && notify-send "Torrent:cheecha download hogyi" && rm -f $file || notify-send -u critical "Torrent:cheecha error!!" rm -f $HOME/.cache/*.torrent } -if [ -z "$*" ]; then - magnet="$(xclip -out clipboard)" +trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP +file=$HOME/.cache/maglink +xclip -out clipboard > $file + +if [ -f "$file" ]; then + magnet=$(cat $file) else magnet=$* fi echo "$magnet" x=$(printf "MOVIES\\nSoftwares" | dmenu -p "Select Directory :" | tr -d '\n') -printf "Download>>>\n[f]ull torrent\n[p]artial torrent\n\tenter choice:" +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) full_tor "$magnet" "$x";; p) part_tor "$magnet" "$x";; + q) + break;; esac