mirror of
https://github.com/CoolnsX/repos_scripts.git
synced 2025-12-20 07:15:20 +05:30
It works on my computer
This commit is contained in:
19
ani-new
19
ani-new
@@ -42,6 +42,10 @@ provider_run() {
|
||||
esac
|
||||
}
|
||||
|
||||
allanime_curl() {
|
||||
curl -e 'https://allanime.to' -sL --cipher AES256-SHA256 -G "${base_url}/api" -A "$agent" --data-urlencode "$1" --data-urlencode "$2"
|
||||
}
|
||||
|
||||
base_url="https://api.allanime.day"
|
||||
agent="Mozilla/5.0"
|
||||
[ -n "$2" ] && debug=1
|
||||
@@ -55,7 +59,7 @@ case $(uname -o) in
|
||||
*)
|
||||
os="linux"
|
||||
download_dir="$HOME/Downloads"
|
||||
terminal="foot -e"
|
||||
terminal="$TERMINAL -e"
|
||||
script_dir="$HOME/repos_scripts"
|
||||
;;
|
||||
esac
|
||||
@@ -65,8 +69,9 @@ esac
|
||||
trap "exit 0" INT HUP
|
||||
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 "$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')
|
||||
#shellcheck disable=SC2016
|
||||
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 "$1" ] && url=$(allanime_curl "query=$query" 'variables={"search":{"sortBy":"Recent","allowAdult":true,"allowUnknown":true},"limit":40,"page":1,"translationType":"sub","countryOrigin":"JP"}' | 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-)
|
||||
@@ -74,8 +79,9 @@ id=$(printf "%s" "$url" | cut -f1)
|
||||
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.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')
|
||||
#shellcheck disable=SC2016
|
||||
episode_embed_gql='query ($showId: String!, $translationType: VaildTranslationTypeEnumType!, $episodeString: String!) { episode( showId: $showId translationType: $translationType episodeString: $episodeString ) { episodeString sourceUrls }}'
|
||||
data=$(allanime_curl "variables={\"showId\":\"$id\",\"translationType\":\"sub\",\"countryOrigin\":\"ALL\",\"episodeString\":\"$ep_no\"}" "query=$episode_embed_gql" | tr '{}' '\n' | sed 's|\\u002F|\/|g;s|\\||g' | sed -nE 's|.*sourceUrl":"--([^"]*)".*sourceName":"([^"]*)".*|\2 :\1|p')
|
||||
info_$os "Fetching Embed links"
|
||||
|
||||
#dropbox links
|
||||
@@ -87,9 +93,6 @@ provider_run "wetransfer" "/Kir :/p" "$2"
|
||||
#sharepoint links
|
||||
provider_run "sharepoint" "/S-mp4 :/p" "$2"
|
||||
|
||||
#rumble links
|
||||
provider_run "rumble" "/Rab :/p" "$2"
|
||||
|
||||
#gogoplay links
|
||||
provider_run "gogoplay" "/Luf-mp4 :/p" "$2"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user