mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
add new script and some optimizations
This commit is contained in:
17
ani-new
Executable file
17
ani-new
Executable 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
37
nsfw
@@ -1,29 +1,22 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -z "$*" ]; then
|
||||
printf "enter number:"
|
||||
read -r num
|
||||
else
|
||||
num=$*
|
||||
fi
|
||||
|
||||
mkdir -p $HOME/.cache/$num
|
||||
[ -z "$*" ] && printf "enter(paste) number or link:" && read -r num || num=$*
|
||||
num=$(printf "$num" | cut -d\/ -f5)
|
||||
dir="$HOME/.cache/$num"
|
||||
mkdir -pv $dir
|
||||
trap "rm -rf $dir;exit 0" INT HUP
|
||||
webp="$(curl -s "https://nhentai.net/g/$num/1/")"
|
||||
id=$(printf "$webp" | sed -nE 's/.*galleries\/([^"]*)\/.*/\1/p')
|
||||
pg=$(printf "$webp" | sed -nE 's/.*pages">(.*)/\1/p' | cut -d\< -f1)
|
||||
|
||||
for i in $(seq $pg)
|
||||
do
|
||||
echo "downloading $i.jpg"
|
||||
pg=$(curl -s "https://nhentai.net/g/$num/1/" | sed -nE 's/.*pages">(.*)<\/span><.*/\1/p')
|
||||
echo "pages : $pg"
|
||||
for i in $(seq $pg);do
|
||||
url=$(curl -s "https://nhentai.net/g/$num/$i/" | sed -nE 's/.*<img src="([^"]*)".*/\1/p')
|
||||
i_t=$(printf "%03d" $i)
|
||||
setsid -f curl -s "https://i.nhentai.net/galleries/$id/$i.jpg" -o "$dir/$i_t"
|
||||
sleep 1
|
||||
echo "downloading page $i($url)"
|
||||
setsid -f curl -s "$url" -o "$dir/$i_t"
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "waiting 3 sec for images to download completely"
|
||||
sleep 3
|
||||
echo "converting images to pdf"
|
||||
convert "$dir/*" "$num.pdf" && printf "saved pdf as $num.pdf\nenjoy 😏😏"
|
||||
rm -rf $dir
|
||||
echo "waiting 5 sec for pages to download completely"
|
||||
sleep 5
|
||||
echo "concatenating pages to pdf"
|
||||
convert "$dir/*" "$num.pdf" && printf "saved pdf as $num.pdf\nopening pdf...enjoy 😏😏" && setsid -f xdg-open "$num.pdf"
|
||||
rm -rvf $dir
|
||||
|
||||
33
torrent
33
torrent
@@ -3,28 +3,13 @@
|
||||
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(){
|
||||
down(){
|
||||
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" && 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 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
|
||||
|
||||
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!!"
|
||||
}
|
||||
|
||||
trap "rm -f $HOME/.cache/*.torrent;exit 0" INT HUP
|
||||
@@ -36,15 +21,21 @@ else
|
||||
fi
|
||||
|
||||
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_reset}\n\tenter choice:"
|
||||
read -r ch
|
||||
case $ch in
|
||||
f)
|
||||
full_tor "$magnet" "$x";;
|
||||
down "$magnet" "$x";;
|
||||
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)
|
||||
break;;
|
||||
esac
|
||||
|
||||
39
youtube
39
youtube
@@ -11,38 +11,25 @@ c_magenta="\033[1;35m"
|
||||
c_cyan="\033[1;36m"
|
||||
c_reset="\033[0m"
|
||||
|
||||
#function to extract audio from video
|
||||
ext_audio()
|
||||
#function to download full video/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"
|
||||
}
|
||||
|
||||
#function to extract part of audio from video
|
||||
part_audio()
|
||||
{
|
||||
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()
|
||||
# function to download part of a video/audio..
|
||||
part()
|
||||
{
|
||||
video=$1
|
||||
printf "${c_magenta}Enter Start Point(hh:mm:ss)or(mm:ss)${c_reset}:"
|
||||
read start
|
||||
printf "${c_yellow}Enter End Point(hh:mm:ss)or(mm:ss):${c_cyan}"
|
||||
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..
|
||||
@@ -53,13 +40,13 @@ printf "\n${c_reset}Enter choice:${c_green}"
|
||||
read choice
|
||||
case $choice in
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
break;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user