Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions ani-cli
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

version_number="4.14.1"

#flags
use_tty=0
tty_mode=0
# UI

external_menu() {
Expand Down Expand Up @@ -56,6 +59,10 @@ help_info() {
Delete history
-l, --logview
Show logs
-t, --tty
Use tct or drm backend to use it in tty
tty 1 = tct (default)
tty 2 = drm
-s, --syncplay
Use Syncplay to watch with friends
-S, --select-nth
Expand Down Expand Up @@ -414,10 +421,20 @@ play_episode() {
printf "%s\n" "$episode"
;;
mpv*)
if [ "$use_tty" = 1 ]; then
case "$tty_mode" in
1)
tty_flags="--vo=tct --really-quiet"
;;
2)
tty_flags="--vo=drm"
;;
esac
fi
if [ "$no_detach" = 0 ]; then
nohup $player_function $skip_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" $refr_flag >/dev/null 2>&1 &
nohup $player_function $tty_flags $skip_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode" $refr_flag >/dev/null 2>&1 &
else
$player_function $skip_flag $refr_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode"
$player_function $tty_flags $skip_flag $refr_flag --tls-verify=no --force-media-title="${allanime_title}Episode ${ep_no}" "$episode"
mpv_exitcode=$?
[ "$exit_after_play" = 1 ] && [ -z "$range" ] && exit "$mpv_exitcode"
fi
Expand Down Expand Up @@ -514,6 +531,19 @@ branch="${ANI_CLI_BRANCH:-master}"

while [ $# -gt 0 ]; do
case "$1" in
-t | --tty)
use_tty=1
no_detach=1
tty_mode=1
if [ $# -gt 1 ]; then
case "$2" in
1|2)
tty_mode="$2"
shift
;;
esac
fi
;;
-v | --vlc)
case "$(uname -a | cut -d " " -f 1,3-)" in
*ndroid*) player_function="android_vlc" ;;
Expand Down
Loading