diff --git a/ani-new b/ani-new new file mode 100755 index 0000000..e16064b --- /dev/null +++ b/ani-new @@ -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:]]*(.*)/\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/.*>\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 diff --git a/youtube b/youtube index ba360ad..2b50587 100755 --- a/youtube +++ b/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