add new script and some optimizations

This commit is contained in:
CoolnsX
2022-02-19 15:22:26 +05:30
parent 8118953030
commit 0e9dfc1577
4 changed files with 57 additions and 69 deletions

17
ani-new Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
decrypt_link() {
ajax_url='https://gogoplay.io/encrypt-ajax.php'
video_id=$(printf "$1" | cut -d\? -f2 | cut -d\& -f1 | sed 's/id=//g')
secret_key='3235373436353338353932393338333936373634363632383739383333323838'
iv='34323036393133333738303038313335'
ajax=$(printf "$video_id" | openssl enc -aes256 -K "$secret_key" -iv "$iv" -a)
curl -s -H 'x-requested-with:XMLHttpRequest' "$ajax_url" -d "id=$ajax" -d "time=69420691337800813569" | jq -r '.source[].file' | head -4 | tail -1
}
url=$(curl -s "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
refr=$(curl -s "https://gogoanime.film/$url" | sed -n -E 's/^[[:space:]]*<a href="#" rel="100" data-video="([^"]*)".*/\1/p')
video=$(decrypt_link "$refr")
notify-send "Downloading $url"
st -e aria2c --summary-interval=0 -x 16 -s 16 --referer="https:$refr" "$video" -o "$url.mp4" --download-result=hide && notify-send "Downloaded $url"

37
nsfw
View File

@@ -1,29 +1,22 @@
#!/bin/sh #!/bin/sh
if [ -z "$*" ]; then [ -z "$*" ] && printf "enter(paste) number or link:" && read -r num || num=$*
printf "enter number:" num=$(printf "$num" | cut -d\/ -f5)
read -r num
else
num=$*
fi
mkdir -p $HOME/.cache/$num
dir="$HOME/.cache/$num" dir="$HOME/.cache/$num"
mkdir -pv $dir
trap "rm -rf $dir;exit 0" INT HUP trap "rm -rf $dir;exit 0" INT HUP
webp="$(curl -s "https://nhentai.net/g/$num/1/")" pg=$(curl -s "https://nhentai.net/g/$num/1/" | sed -nE 's/.*pages">(.*)<\/span><.*/\1/p')
id=$(printf "$webp" | sed -nE 's/.*galleries\/([^"]*)\/.*/\1/p') echo "pages : $pg"
pg=$(printf "$webp" | sed -nE 's/.*pages">(.*)/\1/p' | cut -d\< -f1) for i in $(seq $pg);do
url=$(curl -s "https://nhentai.net/g/$num/$i/" | sed -nE 's/.*<img src="([^"]*)".*/\1/p')
for i in $(seq $pg)
do
echo "downloading $i.jpg"
i_t=$(printf "%03d" $i) i_t=$(printf "%03d" $i)
setsid -f curl -s "https://i.nhentai.net/galleries/$id/$i.jpg" -o "$dir/$i_t" echo "downloading page $i($url)"
sleep 1 setsid -f curl -s "$url" -o "$dir/$i_t"
sleep 2
done done
echo "waiting 3 sec for images to download completely" echo "waiting 5 sec for pages to download completely"
sleep 3 sleep 5
echo "converting images to pdf" echo "concatenating pages to pdf"
convert "$dir/*" "$num.pdf" && printf "saved pdf as $num.pdf\nenjoy 😏😏" convert "$dir/*" "$num.pdf" && printf "saved pdf as $num.pdf\nopening pdf...enjoy 😏😏" && setsid -f xdg-open "$num.pdf"
rm -rf $dir rm -rvf $dir

33
torrent
View File

@@ -3,28 +3,13 @@
c_red="\033[1;31m" c_red="\033[1;31m"
c_green="\033[1;32m" c_green="\033[1;32m"
c_yellow="\033[1;33m" c_yellow="\033[1;33m"
c_blue="\033[1;34m"
c_magenta="\033[1;35m"
c_cyan="\033[1;36m" c_cyan="\033[1;36m"
c_reset="\033[0m" c_reset="\033[0m"
full_tor(){ down(){
tput reset tput reset
notify-send "Torrent:Rukk ja cheecha Download ho rha hai" notify-send "Torrent: Downloading"
aria2c -d $2 --seed-time=0 "$1" && notify-send "Torrent:cheecha download hogyi" && rm -f $file || notify-send -u critical "Torrent:cheecha error!!" aria2c -d $2 --select-file=$3 --seed-time=0 $1 && notify-send "Torrent: Download complete" && rm -f $file || notify-send -u critical "Torrent: 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 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" && rm -f $file || notify-send -u critical "Torrent:cheecha error!!"
rm -f $HOME/.cache/*.torrent
} }
trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP
@@ -36,15 +21,21 @@ else
fi fi
echo "$magnet" echo "$magnet"
x=$(printf "MOVIES\\nSoftwares" | dmenu -p "Select Directory :" | tr -d '\n') 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_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:"
read -r ch read -r ch
case $ch in case $ch in
f) f)
full_tor "$magnet" "$x";; down "$magnet" "$x";;
p) p)
part_tor "$magnet" "$x";; 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"
rm -f $HOME/.cache/*.torrent;;
q) q)
break;; break;;
esac esac

39
youtube
View File

@@ -11,38 +11,25 @@ c_magenta="\033[1;35m"
c_cyan="\033[1;36m" c_cyan="\033[1;36m"
c_reset="\033[0m" c_reset="\033[0m"
#function to extract audio from video #function to download full video/audio
ext_audio() full()
{ {
[ -z "$2" ] &&
yt-dlp -o "$HOME/Videos/%(title)s.%(ext)s" "$1" ||
yt-dlp -f 'ba' -x --audio-format mp3 "$1" -o "$HOME/Music/%(title)s.%(ext)s" yt-dlp -f 'ba' -x --audio-format mp3 "$1" -o "$HOME/Music/%(title)s.%(ext)s"
} }
#function to extract part of audio from video # function to download part of a video/audio..
part_audio() part()
{
video=$1
printf "${c_magenta}Enter Starting Point(hh:mm:ss)or(mm:ss)${c_reset}:"
read start
printf "${c_yellow}Enter Upto Seconds:${c_cyan}"
read end
ffmpeg -i $(yt-dlp -f 'ba' --get-url "$video") -ss $start -t $end -map a -q:a 0 "$HOME/Music/%(title)s.mp3"
}
#function to download full video
full_video()
{
yt-dlp -o "$HOME/Videos/%(title)s.%(ext)s" "$1"
}
# function to download part of a video and also split it for SNS...
part_video()
{ {
video=$1 video=$1
printf "${c_magenta}Enter Start Point(hh:mm:ss)or(mm:ss)${c_reset}:" printf "${c_magenta}Enter Start Point(hh:mm:ss)or(mm:ss)${c_reset}:"
read start read start
printf "${c_yellow}Enter End Point(hh:mm:ss)or(mm:ss):${c_cyan}" printf "${c_yellow}Enter End Point(hh:mm:ss)or(mm:ss):${c_cyan}"
read end read end
ffmpeg -i $(yt-dlp -f b --get-url "$video") -ss $start -to $end "$HOME/Videos/%(title)s.mp4" [ -z "$2" ] &&
ffmpeg -i $(yt-dlp -f b --get-url "$video") -ss $start -to $end "$HOME/Videos/%(title)s.mp4" ||
ffmpeg -i $(yt-dlp -f 'ba' --get-url "$video") -ss $start -t $end -map a -q:a 0 "$HOME/Music/%(title)s.mp3"
} }
#program starts from here.. #program starts from here..
@@ -53,13 +40,13 @@ printf "\n${c_reset}Enter choice:${c_green}"
read choice read choice
case $choice in case $choice in
a) a)
ext_audio "$x" && notify-send "Audio saved to Videos Directory" || notify-send -u critical "Error!!! Audio not Downloaded";; full "$x" "1" && notify-send "Audio saved to Music Directory" || notify-send -u critical "Error!!! Audio not Downloaded";;
f) f)
part_audio "$x" && notify-send "Audio saved to Videos Directory" || notify-send -u critical "Error!!! Audio not Downloaded";; part "$x" "1" && notify-send "Audio saved to Music Directory" || notify-send -u critical "Error!!! Audio not Downloaded";;
v) v)
full_video "$x" && notify-send "Video saved to Videos Directory" || notify-send -u critical "Error!!! Video not Downloaded";; full "$x" && notify-send "Video saved to Videos Directory" || notify-send -u critical "Error!!! Video not Downloaded";;
p) p)
part_video "$x" && notify-send "Video saved to Videos Directory" || notify-send -u critical "Error!!! Video not Downloaded";; part "$x" && notify-send "Video saved to Videos Directory" || notify-send -u critical "Error!!! Video not Downloaded";;
q) q)
break;; break;;
esac esac