diff --git a/ani-new b/ani-new index 3aaedb0..b23a303 100755 --- a/ani-new +++ b/ani-new @@ -51,7 +51,7 @@ printf "%s\n" "$url" | while read -r id title; do data=$(curl -e "https://allanime.to" -sL -G "https://api.${domain}/api" -A "$agent" --data-urlencode "variables={\"showId\":\"$id\",\"translationType\":\"sub\",\"countryOrigin\":\"ALL\",\"episodeString\":\"$ep_no\"}" --data-urlencode 'query=query ($showId: String!, $translationType: VaildTranslationTypeEnumType!, $episodeString: String!) { episode( showId: $showId translationType: $translationType episodeString: $episodeString ) { episodeString sourceUrls }}' | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":"--([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p') info_$os "Fetching Embed links" - printf 'Youtube\tYt-mp4\nsharepoint\tS-mp4\nhianime\tLuf-Mp4\n' | while read -r provider_name provider_regex; do + printf 'sharepoint\tS-mp4\nYoutube\tYt-mp4\nhianime\tLuf-Mp4\n' | while read -r provider_name provider_regex; do info_$os "Fetching $provider_name links" provider_id="$(printf "%s" "$data" | sed -n "/$provider_regex :/p" | cut -d':' -f2 | sed 's/../&\n/g' | sed 's/^79$/A/g;s/^7a$/B/g;s/^7b$/C/g;s/^7c$/D/g;s/^7d$/E/g;s/^7e$/F/g;s/^7f$/G/g;s/^70$/H/g;s/^71$/I/g;s/^72$/J/g;s/^73$/K/g;s/^74$/L/g;s/^75$/M/g;s/^76$/N/g;s/^77$/O/g;s/^68$/P/g;s/^69$/Q/g;s/^6a$/R/g;s/^6b$/S/g;s/^6c$/T/g;s/^6d$/U/g;s/^6e$/V/g;s/^6f$/W/g;s/^60$/X/g;s/^61$/Y/g;s/^62$/Z/g;s/^59$/a/g;s/^5a$/b/g;s/^5b$/c/g;s/^5c$/d/g;s/^5d$/e/g;s/^5e$/f/g;s/^5f$/g/g;s/^50$/h/g;s/^51$/i/g;s/^52$/j/g;s/^53$/k/g;s/^54$/l/g;s/^55$/m/g;s/^56$/n/g;s/^57$/o/g;s/^48$/p/g;s/^49$/q/g;s/^4a$/r/g;s/^4b$/s/g;s/^4c$/t/g;s/^4d$/u/g;s/^4e$/v/g;s/^4f$/w/g;s/^40$/x/g;s/^41$/y/g;s/^42$/z/g;s/^08$/0/g;s/^09$/1/g;s/^0a$/2/g;s/^0b$/3/g;s/^0c$/4/g;s/^0d$/5/g;s/^0e$/6/g;s/^0f$/7/g;s/^00$/8/g;s/^01$/9/g;s/^15$/-/g;s/^16$/./g;s/^67$/_/g;s/^46$/~/g;s/^02$/:/g;s/^17$/\//g;s/^07$/?/g;s/^1b$/#/g;s/^63$/\[/g;s/^65$/\]/g;s/^78$/@/g;s/^19$/!/g;s/^1c$/$/g;s/^1e$/&/g;s/^10$/\(/g;s/^11$/\)/g;s/^12$/*/g;s/^13$/+/g;s/^14$/,/g;s/^03$/;/g;s/^05$/=/g;s/^1d$/%/g;' | tr -d '\n' | sed "s/\/clock/\/clock\.json/")" [ -z "$provider_id" ] && continue diff --git a/download b/download index bdd9331..1da46f5 100755 --- a/download +++ b/download @@ -20,7 +20,6 @@ notify_linux() { #main link="$1" -agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/13$(head /dev/urandom | tr -dc '0-5' | cut -c1).0.0.0 Safari/537.36" case $(uname -o) in *ndroid*) @@ -35,77 +34,9 @@ case $(uname -o) in ;; esac -printf "\033[1;34m Video link :\033[0m%s\n" "$link" -case "$link" in - *instagram*) - app="Instagram" - id=$(printf "%s" "$link" | cut -d'/' -f5) - [ -z "$id" ] && error "Unable to extract ID" "$app" "$id" - info "Decoding ID" "$app" "$id" - res=0 - enc_char="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" - table=$(printf "%s" "$enc_char" | sed 's/\(.\)/\1\n/g' | nl -v0 | tr '\t' ':' | tr -d ' ') - for key in $(printf "%s" "$id" | sed -e 's/\(.\)/\1\n/g'); do - value=$(printf "%s" "$table" | sed -nE "s/([^:]*):$key/\1/p") - res=$((res * 64 + value)) - done +printf "\033[1;34m Video link :\033[0m %s\n" "$link" - info "Fetching Video URL" "$app" "$id" - # main source - video_url=$(curl -s "https://i.instagram.com/api/v1/web/get_ruling_for_content/?content_type=MEDIA&target_id=$res" -H "x-ig-app-id:936619743392459" -H "x-ig-www-claim:0" -A "$agent" -c - -o /dev/null | curl -A "$agent" -s -G "https://www.instagram.com/graphql/query/" -H "content-type:application/json" --data-urlencode 'query_hash=9f8827793ef34641b2fb195d4d41151c' --data-urlencode 'variables={"shortcode":"'"$id"'","include_reel":false,"include_logged_out":false}' -e "$link" -b - | tr '{}' '\n' | sed -nE 's|.*video_url":"([^"]*)".*|\1|p' | sed 's/\u0026/\&/g;s/\\//g') - # alternate source - ! printf "%s" "$video_url" | grep -qE 'instagram.*mp4' && info "Using Alternate Site" "Instagram" "$id" && video_url=$(curl -s 'https://snapinsta.net/download.php' --compressed -X POST -H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0' -H 'Referer: https://snapinsta.net/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept-Encoding: gzip, deflate, br, zstd' --data-urlencode "url=$1" | sed 's/\\//g;s/\&/\&/g' | sed -nE 's|.*> 1)) - droid_agent="com.google.android.youtube/$andy_yt_ver (Linux; U; Android 1$random_no) gzip" - json="{ - \"context\": { - \"client\": { - \"clientName\": \"ANDROID\", - \"clientVersion\": \"$andy_yt_ver\", - \"androidSdkVersion\": $((random_no + extra_up + 29)), - \"userAgent\": \"$droid_agent\", - \"hl\": \"en\", - \"timeZone\": \"Asia/Calcutta\", - \"utcOffsetMinutes\": 330 - } - }, - \"videoId\": \"$id\", - \"playbackContext\": { - \"contentPlaybackContext\": { - \"html5Preference\": \"HTML5_PREF_WANTS\" - } - }, - \"contentCheckOk\": true, - \"racyCheckOk\": true - }" - # main source - video_url=$(curl -X POST -A "$agent" -s "https://www.youtube.com/youtubei/v1/player?key=AIzaSyAO_FJ2SlqU8Q4STEHLGCilw_Y9_11qcW8&prettyPrint=false" -H "content-type:application/json" -d "$json" -e "$link" | tr '{}' '\n' | sed -nE 's|.*,"title":"([^"]*)".*|\tout=\1\.mp4|p;s|.*itag":18,"url":"([^"]*)".*|\1|p;s|.*itag":22,"url":"([^"]*)".*|\1|p' | tail -2) - # fallback source - printf "%s" "$video_url" | grep -q "googlevideo\.com" || fallback=1 - ;; - *) - info "Invalid URL" "none" "none" - exit 0 - ;; -esac +yt-dlp --no-skip-unavailable-fragments --fragment-retries infinite -N 16 -t mp4 "$link" -o "$download_dir/%(title)s.%(ext)s" -if [ -n "$fallback" ]; then - info "Using fallback" "$app" "$id" - yt-dlp --no-skip-unavailable-fragments --fragment-retries infinite -N 16 -S 'res,ext:mp4:m4a' --recode mp4 "$link" -o "$download_dir/%(title)s.%(ext)s" -else - info "Downloading Video" "$app" "$id" - printf "%s" "$video_url" | aria2c -x16 -s16 -j10 -k'1M' --user-agent="$agent" -d "$download_dir" -i - --download-result=hide --summary-interval=0 || notify_$os "Unable to Download $app Video" -fi - -notify_$os "$app Video Downloaded" +notify_$os "Video Downloaded" exit 0 diff --git a/tor-bay b/tor-bay deleted file mode 100755 index 2845e69..0000000 --- a/tor-bay +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -#this script uses the piratesbay api to search for torrents - -cal_size() { - printf "%.03f\n" "$(($1 / 1000))e-6" -} - -display() { - for i in $(seq "$(printf "%s\nlol" "$2" | wc -l)"); do - printf "[%s GB;S:%s\n" "$(cal_size "$(printf "%s" "$1" | sed -n "${i}p")")" "$(printf "%s" "$2" | sed -n "${i}p")" & - done - wait -} - -os="linux" -uname -o | grep -q "ndroid" && os="droid" - -# shellcheck disable=SC1091,SC1090 -. "$(dirname "$0")"/.functions -[ -z "$*" ] && search_$os "Search Torrent: " || query=$* -[ -z "$query" ] && exit 0 -[ "$os" = "linux" ] && tmp=$(notify-send -e "Searching query" -p) -query=$(printf "%s" "$query" | tr " " "+") -data=$(curl -s "https://apibay.org/q.php?q=$query" | sed 's/},/}\n/g' | tr -d "[]") - -[ "$os" = "linux" ] && notify-send -e "tidying up data" -r "$tmp" -size=$(printf "%s" "$data" | sed -nE 's/.*name.*size":"(.*)",.*user.*/\1/p') -name_seed=$(printf "%s" "$data" | sed -nE 's/.*name":"(.*)","info_hash.*seeders":"(.*)",.*num.*/\2] \1/p') -sel=$(display "$size" "$name_seed" | menu_$os "Select Torrent: " | cut -d" " -f3-) -[ -z "$sel" ] && exit 0 -magnet="magnet:?xt=urn:btih:$(printf "%s" "$data" | sed -nE 's/.*name":"(.*)","info_hash":"(.*)",.*leech.*/\2\t\1/p' | sed -n "s/\t$sel//p")" -torrent_$os "$magnet" diff --git a/tor-cli b/tor-cli deleted file mode 100755 index d56c4cd..0000000 --- a/tor-cli +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -os="linux" -uname -o | grep -q "ndroid" && os="droid" -# shellcheck disable=SC1091,SC1090 -. "$(dirname "$0")"/.functions - -[ -z "$*" ] && search_$os "Search Torrent: " || query=$* -[ -z "$query" ] && exit 0 -query=$(printf "%s" "$query" | tr ' ' '+') -magnet=$(curl -s "https://thepiratebay0.org/s/?page=0&orderby=0&q=$query" | tr '\n' ' ' | sed -e 's__\n_g;s_ \;__g' | sed -nE 's_.*title.*">([^<]*).*a href="(magnet[^"]*)".*Size ([^,]*).*">([^<]*)<.*<.*_\[size:\3,se:\4\]\t\1\t\2_p' | fzf -d'\t' --with-nth ..2 | cut -f3) -[ -z "$magnet" ] || torrent_$os "$magnet" diff --git a/yt-music b/yt-music index b005332..d9f721d 100755 --- a/yt-music +++ b/yt-music @@ -212,7 +212,7 @@ search_play() { [ -z "$query" ] && notify-send -e "Err.. Search query empty" -u critical -h "string:x-canonical-private-synchronous:${0##*/}" && exit 1 #storing context - printf '{"client":{"clientName":"WEB_REMIX","clientVersion":"1.20250310.01.00"}}' >"$logdir/context" + printf '{"client":{"clientName":"WEB_REMIX","clientVersion":"1.20250616.03.00"}}' >"$logdir/context" #extracting your cookies so that the song list are according to your taste get_cookies @@ -285,10 +285,10 @@ random_no=$(head /dev/urandom | tr -dc '1-5' | cut -c1) # android extra_up=$((random_no > 1)) # youtube -yt_ver="20.17.41" +yt_ver="20.23.40" yt_agent="com.google.android.youtube/$yt_ver (Linux; U; Android 1$random_no) gzip" # youtube music -yt_music_ver="8.17.52" +yt_music_ver="8.23.51" yt_music_agent="com.google.android.apps.youtube.music/$yt_music_ver (Linux; U; Android 1$random_no) gzip"