diff --git a/README.md b/README.md index 2db1810e3..4ab3857c1 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ A cli to browse and watch anime (alone AND with friends). This tool scrapes the - [From Source](#installing-from-source) - [Uninstall](#uninstall) - [Dependencies](#dependencies-1) + - [Ani-Skip](#ani-skip) - [Homies](#homies) - [Contribution Guidelines](./CONTRIBUTING.md) - [Disclaimer](./disclaimer.md) @@ -400,6 +401,19 @@ apk del grep sed curl fzf git aria2 ffmpeg ncurses - yt-dlp - m3u8 Downloader - ffmpeg - m3u8 Downloader (fallback) - fzf - User interface +- ani-skip (optional) + +### Ani-Skip + +Ani-skip is a script to automatically skip anime opening sequences, making it easier to watch your favorite shows without having to manually skip the intros each time (from the original [README](https://github.com/synacktraa/ani-skip/tree/master#a-script-to-automatically-skip-anime-opening-sequences-making-it-easier-to-watch-your-favorite-shows-without-having-to-manually-skip-the-intros-each-time)). + +For install instructions visit [ani-skip](https://github.com/synacktraa/ani-skip). + +Ani-skip uses the external lua script function of mpv and as such – for now – only works with mpv. + +**Warning:** For now, ani-skip does **not** seem to work under Windows. + +**Note:** It may be, that ani-skip won't know the anime you're trying to watch (It uses the [aniskip API](https://github.com/lexesjan/typescript-aniskip-extension/tree/main/src/api/aniskip-http-client) and you can contribute missing anime or ask for including it in the database on their [discord server](https://discord.com/invite/UqT55CbrbE)). ## Homies diff --git a/ani-cli b/ani-cli index 4454c3b6d..264d5b198 100755 --- a/ani-cli +++ b/ani-cli @@ -1,6 +1,6 @@ #!/bin/sh -version_number="4.6.2" +version_number="4.7.0" # UI @@ -63,6 +63,8 @@ help_info() { Play dubbed version --rofi Use rofi instead of fzf for the interactive menu + --skip + Use ani-skip to skip the intro of the episode (mpv only) -U, --update Update the script Some example usages: @@ -237,13 +239,15 @@ download() { } play_episode() { + [ "$skip_intro" = 1 ] && skip_flag="$(ani-skip "$title" "$ep_no")" [ -z "$episode" ] && get_episode_url + # shellcheck disable=SC2086 case "$player_function" in debug) [ -z "$ANI_CLI_NON_INTERACTIVE" ] && printf "All links:\n%s\nSelected link:\n" "$links" printf "%s\n" "$episode" ;; - mpv*) nohup "$player_function" --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" >/dev/null 2>&1 & ;; + mpv*) nohup "$player_function" $skip_flag --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" >/dev/null 2>&1 & ;; android_mpv) nohup am start --user 0 -a android.intent.action.VIEW -d "$episode" -n is.xyz.mpv/.MPVActivity >/dev/null 2>&1 & ;; android_vlc) nohup am start --user 0 -a android.intent.action.VIEW -d "$episode" -n org.videolan.vlc/org.videolan.vlc.gui.video.VideoPlayerActivity -e "title" "${allanime_title}Episode ${ep_no}" >/dev/null 2>&1 & ;; iina) nohup "$player_function" --no-stdin --keep-running --mpv-force-media-title="${allanime_title}Episode ${ep_no}" "$episode" >/dev/null 2>&1 & ;; @@ -308,6 +312,7 @@ case "$(uname -a)" in esac use_external_menu="${ANI_CLI_EXTERNAL_MENU:-0}" +skip_intro="${ANI_CLI_SKIP_INTRO:-0}" [ -t 0 ] || use_external_menu=1 hist_dir="${ANI_CLI_HIST_DIR:-${XDG_STATE_HOME:-$HOME/.local/state}/ani-cli}" [ ! -d "$hist_dir" ] && mkdir -p "$hist_dir" @@ -361,6 +366,7 @@ while [ $# -gt 0 ]; do ;; --dub) mode="dub" ;; --rofi) use_external_menu=1 ;; + --skip) skip_intro=1 ;; -U | --update) update_script ;; *) query="$(printf "%s" "$query $1" | sed "s|^ ||;s| |+|g")" ;; esac @@ -370,6 +376,7 @@ done [ "$use_external_menu" = "1" ] && multi_selection_flag="${ANI_CLI_MULTI_SELECTION:-"-multi-select"}" printf "\33[2K\r\033[1;34mChecking dependencies...\033\n[0m" dep_ch "curl" "sed" "grep" || true +[ "$skip_intro" = 1 ] && (dep_ch "ani-skip" || true) if [ -z "$ANI_CLI_NON_INTERACTIVE" ]; then dep_ch fzf || true; fi case "$player_function" in debug) ;; diff --git a/ani-cli.1 b/ani-cli.1 index f77a5032b..24d1b93c0 100644 --- a/ani-cli.1 +++ b/ani-cli.1 @@ -57,6 +57,9 @@ Play the dubbed version. Without this flag, it'll always play the subbed version .TP \fB\--rofi\fR Use rofi instead of fzf for the interactive menu +.TP +\fB\--skip\fR +Use ani-skip to skip the intro of the episode (mpv only) .PP .SH ENVIRONMENT VARIABLES @@ -89,6 +92,9 @@ Controls the directory ani-cli uses for storing history. A /ani-cli subfolder is .TP \fBANI_CLI_DEFAULT_SOURCE\fR Controls the default source. Valid is history (equivalent to -c), everything else means search. Default is search. +.TP +\fBANI_CLI_SKIP_INTRO\fR +Controls if ani-skip is used to skip intros (works with mpv only). Can be 0 (disabled) or 1 (enabled). Default is 0. .PP .SH EPISODE SELECTION .PP