From 87cf4ef51f067727ee9be76f54dd0216cf127116 Mon Sep 17 00:00:00 2001 From: Vishwa Pravin Date: Fri, 7 Oct 2022 22:13:17 +0530 Subject: [PATCH 1/4] Update to Latest API --- animepahe-dl.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/animepahe-dl.sh b/animepahe-dl.sh index 5395375..54e0543 100755 --- a/animepahe-dl.sh +++ b/animepahe-dl.sh @@ -167,10 +167,9 @@ download_source() { get_episode_link() { # $1: episode number local i s d r="" - i=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .anime_id' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") s=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .session' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") - [[ "$i" == "" ]] && print_warn "Episode $1 not found!" && return - d="$(get "${_API_URL}?m=embed&id=${i}&session=${s}&p=kwik" | "$_JQ" -r '.data[]')" + [[ "$s" == "" ]] && print_warn "Episode $1 not found!" && return + d="$(get "${_API_URL}?m=links&id=${s}&p=kwik" | "$_JQ" -r '.data[]')" if [[ -n "${_ANIME_AUDIO:-}" ]]; then print_info "Select audio language: $_ANIME_AUDIO" From 066c4e74bb9dd427aca5656ede66a83125bfde60 Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Fri, 7 Oct 2022 20:24:14 +0200 Subject: [PATCH 2/4] Revert some changes --- animepahe-dl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/animepahe-dl.sh b/animepahe-dl.sh index 54e0543..915cc78 100755 --- a/animepahe-dl.sh +++ b/animepahe-dl.sh @@ -167,8 +167,9 @@ download_source() { get_episode_link() { # $1: episode number local i s d r="" + i=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .anime_id' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") s=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .session' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") - [[ "$s" == "" ]] && print_warn "Episode $1 not found!" && return + [[ "$i" == "" ]] && print_warn "Episode $1 not found!" && return d="$(get "${_API_URL}?m=links&id=${s}&p=kwik" | "$_JQ" -r '.data[]')" if [[ -n "${_ANIME_AUDIO:-}" ]]; then From 3afcabf199c8dad22d6eee96595415aa7b2f489c Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Fri, 7 Oct 2022 20:28:28 +0200 Subject: [PATCH 3/4] Revert "Revert some changes" This reverts commit 066c4e74bb9dd427aca5656ede66a83125bfde60. --- animepahe-dl.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/animepahe-dl.sh b/animepahe-dl.sh index 915cc78..54e0543 100755 --- a/animepahe-dl.sh +++ b/animepahe-dl.sh @@ -167,9 +167,8 @@ download_source() { get_episode_link() { # $1: episode number local i s d r="" - i=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .anime_id' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") s=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .session' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") - [[ "$i" == "" ]] && print_warn "Episode $1 not found!" && return + [[ "$s" == "" ]] && print_warn "Episode $1 not found!" && return d="$(get "${_API_URL}?m=links&id=${s}&p=kwik" | "$_JQ" -r '.data[]')" if [[ -n "${_ANIME_AUDIO:-}" ]]; then From 3b9ac712c4e6834b7664109689179469c06fb7fd Mon Sep 17 00:00:00 2001 From: Kevin Cui Date: Fri, 7 Oct 2022 20:29:54 +0200 Subject: [PATCH 4/4] Remove unused variable --- animepahe-dl.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/animepahe-dl.sh b/animepahe-dl.sh index 54e0543..9a4fe4b 100755 --- a/animepahe-dl.sh +++ b/animepahe-dl.sh @@ -166,7 +166,7 @@ download_source() { get_episode_link() { # $1: episode number - local i s d r="" + local s d r="" s=$("$_JQ" -r '.data[] | select((.episode | tonumber) == ($num | tonumber)) | .session' --arg num "$1" < "$_SCRIPT_PATH/$_ANIME_NAME/$_SOURCE_FILE") [[ "$s" == "" ]] && print_warn "Episode $1 not found!" && return d="$(get "${_API_URL}?m=links&id=${s}&p=kwik" | "$_JQ" -r '.data[]')"