code cleanup

This commit is contained in:
CoolnsX
2022-03-02 22:20:36 +05:30
parent 11729968e7
commit ed4a0cf6c9
3 changed files with 7 additions and 5 deletions

View File

@@ -10,6 +10,7 @@ decrypt_link() {
curl -s -H "X-Requested-With:XMLHttpRequest" -H "User-Agent:$agent" -H "Referer:https:$1" "$ajax_url" -d "id=$ajax" -d "time=69420691337800813569" | jq -r '.source[].file' | head -4 | tail -1 curl -s -H "X-Requested-With:XMLHttpRequest" -H "User-Agent:$agent" -H "Referer:https:$1" "$ajax_url" -d "id=$ajax" -d "time=69420691337800813569" | jq -r '.source[].file' | head -4 | tail -1
} }
notify-send -t 1000 "parsing gogoanime.... please wait!!"
url=$(curl -s -A "$agent" "https://gogoanime.film" | sed -nE 's/.*"name".*href="\/([^"]*)".*/\1/p' | dmenu -p "Select anime:") url=$(curl -s -A "$agent" "https://gogoanime.film" | sed -nE 's/.*"name".*href="\/([^"]*)".*/\1/p' | dmenu -p "Select anime:")
[ -z "$url" ] && notify-send -u critical "Err.. no anime selected" && exit 0 [ -z "$url" ] && notify-send -u critical "Err.. no anime selected" && exit 0
refr=$(curl -s -A "$agent" "https://gogoanime.film/$url" | sed -n -E 's/^[[:space:]]*<a href="#" rel="100" data-video="([^"]*)".*/\1/p') refr=$(curl -s -A "$agent" "https://gogoanime.film/$url" | sed -n -E 's/^[[:space:]]*<a href="#" rel="100" data-video="([^"]*)".*/\1/p')

4
rss
View File

@@ -2,7 +2,7 @@
#script for downloading latest anime episode via torrent using rss provided by website named "subsplease.org" #script for downloading latest anime episode via torrent using rss provided by website named "subsplease.org"
#parsing rss file #parsing rss file
notify-send "Parsing SubsPlease RSS... Please Wait..." notify-send -t 2000 "Parsing SubsPlease RSS... Please Wait..."
curl -s https://subsplease.org/rss/?r=1080 | tr "<" "\n" > $HOME/.cache/rss curl -s https://subsplease.org/rss/?r=1080 | tr "<" "\n" > $HOME/.cache/rss
#extracting names and providing the menu for selecting particular title #extracting names and providing the menu for selecting particular title
@@ -16,4 +16,4 @@ id=$(printf "$name" | sed -n -e 's/.*\[\(.*\)\].*/\1/p')
magnet=$(sed -n -e "s/link>\(.*$id.*\).*/\1/p" .cache/rss | sed 's/amp;//g') magnet=$(sed -n -e "s/link>\(.*$id.*\).*/\1/p" .cache/rss | sed 's/amp;//g')
#custom script for downloading torrent using aria2c.. you can use your own bittorrent client here #custom script for downloading torrent using aria2c.. you can use your own bittorrent client here
setsid -f st -e $HOME/repo_scripts/torrent "$magnet" st -e $HOME/repos_scripts/torrent "$magnet" &

View File

@@ -9,10 +9,11 @@ c_reset="\033[0m"
down(){ down(){
tput reset tput reset
notify-send "Torrent: Downloading" notify-send "Torrent: Downloading"
aria2c -d movies --select-file=$2 --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 trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP
[ -z "$*" ] && magnet=$(xclip -out clipboard) || magnet=$* [ -z "$*" ] && magnet="$(xclip -out clipboard)" || magnet="$*"
echo "$magnet" echo "$magnet"
printf "${c_yellow}Download>>\n${c_green}[f]ull torrent\n${c_cyan}[p]artial torrent \n${c_red}[q]uit" 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:" printf "${c_reset}\n\tenter choice:"
@@ -29,5 +30,5 @@ case $ch in
down "$HOME/.cache/*.torrent" "$ind" down "$HOME/.cache/*.torrent" "$ind"
rm -f $HOME/.cache/*.torrent;; rm -f $HOME/.cache/*.torrent;;
q) q)
break;; exit 0;;
esac esac