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