mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
WIP, always
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
menu_droid () {
|
||||
fzf --prompt="$1" $2
|
||||
fzf --prompt="$1" "$2"
|
||||
}
|
||||
|
||||
menu_linux () {
|
||||
@@ -9,7 +9,7 @@ menu_linux () {
|
||||
}
|
||||
|
||||
search_droid () {
|
||||
printf "$1" && read -r query
|
||||
printf "%s" "$1" && read -r query
|
||||
}
|
||||
|
||||
search_linux () {
|
||||
@@ -17,11 +17,11 @@ search_linux () {
|
||||
}
|
||||
|
||||
torrent_linux () {
|
||||
setsid -f $TERMINAL -e $HOME/repos_scripts/torrent "$1"
|
||||
setsid -f "$TERMINAL" -e "$HOME/repos_scripts/torrent" "$1"
|
||||
}
|
||||
|
||||
torrent_droid () {
|
||||
$HOME/torrent "$1"
|
||||
"$HOME/torrent" "$1"
|
||||
}
|
||||
|
||||
info_droid () {
|
||||
|
||||
44
ani-new
44
ani-new
@@ -16,13 +16,27 @@ down () {
|
||||
exit 0
|
||||
}
|
||||
|
||||
decrypt_allanime() {
|
||||
for result in $(printf '%s' "$1" | xxd -r -p | od -An -v -t u1)
|
||||
do
|
||||
for char in $(printf "%s" "1234567890123456789" | grep -o .)
|
||||
do
|
||||
decimal_char="$(printf "%02d" "'$char'")"
|
||||
: $((result ^= decimal_char))
|
||||
done
|
||||
|
||||
#shellcheck disable=SC2059
|
||||
printf "\\$(printf "%03o" "$result")"
|
||||
done
|
||||
}
|
||||
|
||||
provider_run(){
|
||||
info_$os "Fetching $1 links"
|
||||
hexadecimal_provider_id="$(printf "%s" "$data" | sed -n "$2" | head -1 | cut -d':' -f2 | xxd -r -p)"
|
||||
provider_id=$(printf "%s" "$hexadecimal_provider_id" | sed "s/\/clock/\/clock\.json/")
|
||||
provider_id="$(decrypt_allanime "$(printf "%s" "$data" | sed -n "$2" | head -1 | cut -d':' -f2)" | sed "s/\/clock/\/clock\.json/")"
|
||||
[ -z "$provider_id" ] && return 0
|
||||
provider_video=$(curl -s "https://allanimenews.com$provider_id" | sed 's|},{|\n|g' | sed -nE 's|.*link":"([^"]*)".*"resolutionStr":"([^"]*)".*|\1|p;s|.*hls","url":"([^"]*)".*"hardsub_lang":"en-US".*|\1|p' | head -1)
|
||||
provider_video=$(curl -s "https://embed.ssbcontent.site$provider_id" | sed 's|},{|\n|g' | sed -nE 's|.*link":"([^"]*)".*"resolutionStr":"([^"]*)".*|\1|p;s|.*hls","url":"([^"]*)".*"hardsub_lang":"en-US".*|\1|p' | head -1)
|
||||
[ -z "$provider_video" ] && return 0
|
||||
[ -n "$3" ] && printf "%s : %s\n" "$1" "$provider_video" && return 0
|
||||
case $provider_video in
|
||||
*crunchyroll*) down "$base_url" "$(curl -s "$provider_video" -A "$agent" | sed -n '/x1080/{n;p;}')" "$1" ;;
|
||||
*repackager.wixmp.com*) down "$base_url" "$(printf %s "$provider_video" | cut -d',' -f1,2 | tr -d ',' | sed 's|repackager.wixmp.com/||g')/mp4/file.mp4" "$1" ;;
|
||||
@@ -30,7 +44,7 @@ provider_run(){
|
||||
esac
|
||||
}
|
||||
|
||||
base_url="https://api.allanime.to"
|
||||
base_url="https://api.allanime.day"
|
||||
agent="Mozilla/5.0"
|
||||
|
||||
case $(uname -o) in
|
||||
@@ -54,7 +68,7 @@ info_$os "Parsing $base_url.. Please wait..."
|
||||
|
||||
|
||||
query="query( \$search: SearchInput \$limit: Int \$page: Int \$translationType: VaildTranslationTypeEnumType \$countryOrigin: VaildCountryOriginEnumType ) { shows( search: \$search limit: \$limit page: \$page translationType: \$translationType countryOrigin: \$countryOrigin ) { edges { _id name lastEpisodeInfo __typename } }}"
|
||||
[ -z "$*" ] && url=$(curl -s -G "${base_url}/allanimeapi" -d "variables=%7B%22search%22%3A%7B%22sortBy%22%3A%22Recent%22%2C%22allowAdult%22%3Atrue%2C%22allowUnknown%22%3Atrue%7D%2C%22limit%22%3A40%2C%22page%22%3A1%2C%22translationType%22%3A%22sub%22%2C%22countryOrigin%22%3A%22JP%22%7D" --data-urlencode "query=$query" -A "$agent" | sed 's|Show|\n|g' | sed -nE 's|.*_id":"([^"]*)","name":"([^"]*)".*sub":\{"episodeString":"([^"]*)".*|\1\t\2 Episode \3|p' | menu_$os "Select Anime: " '--with-nth 2..' | tr ':' ' ' | tr -s ' ') || url=$(printf "%s" "$*" | sed -nE 's|.*/watch/(.*)-sub|\1|p')
|
||||
[ -z "$1" ] && url=$(curl -e 'https://allanime.to' -s --cipher 'AES256-SHA256' -G "${base_url}/api" -d "variables=%7B%22search%22%3A%7B%22sortBy%22%3A%22Recent%22%2C%22allowAdult%22%3Atrue%2C%22allowUnknown%22%3Atrue%7D%2C%22limit%22%3A40%2C%22page%22%3A1%2C%22translationType%22%3A%22sub%22%2C%22countryOrigin%22%3A%22JP%22%7D" --data-urlencode "query=$query" -A "$agent" | sed 's|Show|\n|g' | sed -nE 's|.*_id":"([^"]*)","name":"([^"]*)".*sub":\{"episodeString":"([^"]*)".*|\1\t\2 Episode \3|p' | menu_$os "Select Anime: " '--with-nth 2..' | tr ':' ' ' | tr -s ' ') || url=$(printf "%s" "$1" | sed -nE 's|.*/watch/(.*)-sub|\1|p')
|
||||
|
||||
[ -z "$url" ] && error_$os "No anime selected" && exit 0
|
||||
title=$(printf "%s" "$url" | cut -f2-)
|
||||
@@ -63,30 +77,24 @@ ep_no=$(printf "%s" "$url" | sed 's/.*Episode //g')
|
||||
|
||||
info_$os "Loading Episode $title.."
|
||||
episode_embed_gql="query (\$showId: String!, \$translationType: VaildTranslationTypeEnumType!, \$episodeString: String!) { episode( showId: \$showId translationType: \$translationType episodeString: \$episodeString ) { episodeString sourceUrls }}"
|
||||
data=$( curl -e https://allanime.co -s --cipher AES256-SHA256 -G 'https://api.allanime.co/allanimeapi' --data-urlencode "variables={\"showId\":\"$id\",\"translationType\":\"sub\",\"countryOrigin\":\"ALL\",\"episodeString\":\"$ep_no\"}" --data-urlencode "query=$episode_embed_gql" -A 'Mozilla/5.0 (Windows NT 6.1; Win64; rv:109.0) Gecko/20100101 Firefox/109.0' | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":"#([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p')
|
||||
data=$( curl -e https://allanime.to -sL --cipher AES256-SHA256 -G "{$base_url}/api" --data-urlencode "variables={\"showId\":\"$id\",\"translationType\":\"sub\",\"countryOrigin\":\"ALL\",\"episodeString\":\"$ep_no\"}" --data-urlencode "query=$episode_embed_gql" -A 'Mozilla/5.0 (Windows NT 6.1; Win64; rv:109.0) Gecko/20100101 Firefox/109.0' | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":"#?([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p')
|
||||
info_$os "Fetching Embed links"
|
||||
|
||||
#wixmp links
|
||||
provider_run "wixmp" "/Default :/p"
|
||||
|
||||
#dropbox links
|
||||
provider_run "dropbox" "/Sak :/p"
|
||||
provider_run "dropbox" "/Sak :/p" "$2"
|
||||
|
||||
#wetransfer links
|
||||
provider_run "wetransfer" "/Kir :/p"
|
||||
provider_run "wetransfer" "/Kir :/p" "$2"
|
||||
|
||||
#sharepoint links
|
||||
provider_run "sharepoint" "/S-mp4 :/p"
|
||||
|
||||
#vrv links
|
||||
provider_run "vrv" "/Ac :/p"
|
||||
provider_run "sharepoint" "/S-mp4 :/p" "$2"
|
||||
|
||||
#gogoplay links
|
||||
provider_run "gogoplay" "/Luf-mp4 :/p"
|
||||
provider_run "gogoplay" "/Luf-mp4 :/p" "$2"
|
||||
|
||||
id=$(printf "%s" "$data" | sed -nE 's/Vid-mp4 :(.*)/\1/p')
|
||||
id=$(printf "%s" "$data" | sed -nE 's/Vid-mp4 :.*?id=([^&]*).*/\1/p')
|
||||
[ -z "$id" ] && error_$os "no more mirror links..sorry" && exit 0
|
||||
resp="$(curl -A "$agent" -s "https://anihdplay.com/streaming.php?id=$id" | sed -nE 's/.*data-status="1".*data-video="(.*)">.*/\1/p')"
|
||||
resp="$(curl -A "$agent" -s "https://playtaku.net/streaming.php?id=$id" | sed -nE 's/.*data-status="1".*data-video="(.*)">.*/\1/p')"
|
||||
|
||||
info_$os "Fetching mp4upload links"
|
||||
mp4up_link=$(printf "%s" "$resp" | grep "mp4upload")
|
||||
|
||||
Reference in New Issue
Block a user