From c119cd709f57f23fbd22e72e489026c443f5240d Mon Sep 17 00:00:00 2001 From: makise-ui Date: Tue, 24 Feb 2026 23:30:59 +0530 Subject: [PATCH 1/9] fix: improve downloads (prefer yt-dlp), flexible deps, and update msg --- ani-cli | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ani-cli b/ani-cli index 0b54ca1b..5c8204da 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.10.4" +version_number="4.10.5" # UI @@ -109,7 +109,7 @@ update_script() { if printf '%s\n' "$update" | patch "$0" -; then printf "Script has been updated\n" else - die "Can't update for some reason!" + die "Update failed! Try: curl -fsSL https://raw.githubusercontent.com/pystardust/ani-cli/master/ani-cli -o \"\$0\"" fi fi exit 0 @@ -295,8 +295,12 @@ download() { # [ -e "$download_dir/$2.vtt" ] && ffmpeg -i "$download_dir/$2.mp4" -i "$download_dir/$2.vtt" -c copy -c:s mov_text "$download_dir/$2.bak.mp4" && mv "$download_dir/$2.bak.mp4" "$download_dir/$2.mp4" ;; *) - # shellcheck disable=SC2086 - aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide + if command -v "yt-dlp" >/dev/null; then + yt-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" + else + # shellcheck disable=SC2086 + aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide + fi ;; esac } @@ -487,7 +491,10 @@ dep_ch "curl" "sed" "grep" || true dep_ch "fzf" || true case "$player_function" in debug) ;; - download) dep_ch "ffmpeg" "aria2c" ;; + download) + command -v "yt-dlp" >/dev/null || command -v "ffmpeg" >/dev/null || die "Neither yt-dlp nor ffmpeg found. Please install one." + command -v "yt-dlp" >/dev/null || command -v "aria2c" >/dev/null || die "Neither yt-dlp nor aria2c found. Please install one." + ;; android*) printf "\33[2K\rChecking of players on Android is disabled\n" ;; *iSH*) printf "\33[2K\rChecking of players on iOS is disabled\n" ;; flatpak_mpv) true ;; # handled out of band in where_mpv From fa89a2ad5aad2bb95f53c998717bac8fac72bdc4 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:14:54 +0100 Subject: [PATCH 2/9] don't patch our update error message --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 5c8204da..7d90d16a 100755 --- a/ani-cli +++ b/ani-cli @@ -109,7 +109,7 @@ update_script() { if printf '%s\n' "$update" | patch "$0" -; then printf "Script has been updated\n" else - die "Update failed! Try: curl -fsSL https://raw.githubusercontent.com/pystardust/ani-cli/master/ani-cli -o \"\$0\"" + die "Can't update for some reason!" fi fi exit 0 From b8cc5ca074cdf1f335658990981732eb8efd2af1 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:15:08 +0100 Subject: [PATCH 3/9] bump version one further --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 7d90d16a..bd0c95db 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.10.5" +version_number="4.10.6" # UI From d72b65fe9ae9948bf7a9e930327ed09bf1b819b6 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:16:03 +0100 Subject: [PATCH 4/9] xargs command -v --- ani-cli | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ani-cli b/ani-cli index bd0c95db..cf426fde 100755 --- a/ani-cli +++ b/ani-cli @@ -492,9 +492,7 @@ dep_ch "fzf" || true case "$player_function" in debug) ;; download) - command -v "yt-dlp" >/dev/null || command -v "ffmpeg" >/dev/null || die "Neither yt-dlp nor ffmpeg found. Please install one." - command -v "yt-dlp" >/dev/null || command -v "aria2c" >/dev/null || die "Neither yt-dlp nor aria2c found. Please install one." - ;; + command -v "yt-dlp" >/dev/null || echo "ffmpeg" "aria2c" | xargs -n1 command -v >/dev/null || die "Neither yt-dlp nor ffmpeg and aria2c found. Please install one." ;; android*) printf "\33[2K\rChecking of players on Android is disabled\n" ;; *iSH*) printf "\33[2K\rChecking of players on iOS is disabled\n" ;; flatpak_mpv) true ;; # handled out of band in where_mpv From 78c79143838de96d8c1aae089c511314112e4043 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:17:26 +0100 Subject: [PATCH 5/9] conditional execution --- ani-cli | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/ani-cli b/ani-cli index cf426fde..699d6499 100755 --- a/ani-cli +++ b/ani-cli @@ -295,12 +295,9 @@ download() { # [ -e "$download_dir/$2.vtt" ] && ffmpeg -i "$download_dir/$2.mp4" -i "$download_dir/$2.vtt" -c copy -c:s mov_text "$download_dir/$2.bak.mp4" && mv "$download_dir/$2.bak.mp4" "$download_dir/$2.mp4" ;; *) - if command -v "yt-dlp" >/dev/null; then - yt-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" - else - # shellcheck disable=SC2086 - aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide - fi + command -v "yt-dlp" >/dev/null && t-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" + # shellcheck disable=SC2086 + command -v "yt-dlp" >/dev/null | aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide ;; esac } From 12b97d2fd09a9aebbaa9434c11fd84b130866519 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:56:59 +0100 Subject: [PATCH 6/9] thx shellcheck for catching it --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index d0b74616..77aa260a 100755 --- a/ani-cli +++ b/ani-cli @@ -301,7 +301,7 @@ download() { *) command -v "yt-dlp" >/dev/null && t-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" # shellcheck disable=SC2086 - command -v "yt-dlp" >/dev/null | aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide + command -v "yt-dlp" >/dev/null || aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide ;; esac } From 4ed88973e72c55b0c1d7fe0e1365cbd6b588795b Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 12:59:33 +0100 Subject: [PATCH 7/9] appease shfmt --- ani-cli | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 77aa260a..0d017bae 100755 --- a/ani-cli +++ b/ani-cli @@ -496,7 +496,8 @@ dep_ch "fzf" || true case "$player_function" in debug) ;; download) - command -v "yt-dlp" >/dev/null || echo "ffmpeg" "aria2c" | xargs -n1 command -v >/dev/null || die "Neither yt-dlp nor ffmpeg and aria2c found. Please install one." ;; + command -v "yt-dlp" >/dev/null || echo "ffmpeg" "aria2c" | xargs -n1 command -v >/dev/null || die "Neither yt-dlp nor ffmpeg and aria2c found. Please install one." + ;; android*) printf "\33[2K\rChecking of players on Android is disabled\n" ;; *iSH*) printf "\33[2K\rChecking of players on iOS is disabled\n" ;; flatpak_mpv) true ;; # handled out of band in where_mpv From f4872f6b91d5741cb6604a9fed26702f4c56dbeb Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 13:16:41 +0100 Subject: [PATCH 8/9] bump version again --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 0d017bae..3539a3aa 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.10.6" +version_number="4.10.7" # UI From 0e11cfa1e8dc6e65f2574a901fcffbeefb7e96c0 Mon Sep 17 00:00:00 2001 From: port19 Date: Sat, 14 Mar 2026 13:23:22 +0100 Subject: [PATCH 9/9] t-dlp is not yt-dlp --- ani-cli | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ani-cli b/ani-cli index 83f32b32..6e91b087 100755 --- a/ani-cli +++ b/ani-cli @@ -299,7 +299,7 @@ download() { # [ -e "$download_dir/$2.vtt" ] && ffmpeg -i "$download_dir/$2.mp4" -i "$download_dir/$2.vtt" -c copy -c:s mov_text "$download_dir/$2.bak.mp4" && mv "$download_dir/$2.bak.mp4" "$download_dir/$2.mp4" ;; *) - command -v "yt-dlp" >/dev/null && t-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" + command -v "yt-dlp" >/dev/null && yt-dlp --referer "$allanime_refr" -o "$download_dir/$2.mp4" "$1" # shellcheck disable=SC2086 command -v "yt-dlp" >/dev/null || aria2c --referer="$allanime_refr" --enable-rpc=false --check-certificate=false --continue $iSH_DownFix --summary-interval=0 -x 16 -s 16 "$1" --dir="$download_dir" -o "$2.mp4" --download-result=hide ;;