pystardust / ani-cli

A cli tool to browse and play anime
GNU General Public License v3.0
7.63k stars 533 forks source link

feat: added support for ani-skip to skip episode intros #1231

Closed AzureOrange404 closed 8 months ago

AzureOrange404 commented 10 months ago

Pull Request

Type of change

Description

I saw the issue #1223 and sympathized with the idea of skipping intros. So implemented the skipping function into ani-cli (it still needs ani-skip to be installed though.)

Skipping does not work for all anime I've tested, but does for some. If ani-skip fails, ani-cli just prints a message stating, that it failed and proceeds as normal.

Also it only works with mpv (due to how ani-skip works) and this is noted in the help function as well as the man page.

Checklist

Additional Testcases

synacktraa commented 9 months ago

Someone will have to first take me through ani-cli code, especially the episode range parsing thing.

synacktraa commented 9 months ago

@synacktraa also pls implement skipping for outro as well

Here you go. https://github.com/synacktraa/ani-skip/commit/657a1de142ed1f7f846b130540cbb4564f7c42fa @71zenith

port19x commented 9 months ago

I plan to merge and release sometime later today

port19x commented 9 months ago

Looks good and works on my end

Needs sign off from @Derisis13 due to requested changes

lasersPew commented 9 months ago

Imma test some stuff with windows and WSL.

synacktraa commented 9 months ago

Imma test some stuff with windows and WSL.

ani-skip is working in Wsl Try gitbash too if possible

manorit2001 commented 9 months ago

I am on Manjaro, not sure if that affects but getting the following output for ani-skip and one piece, am I doing something wrong? I tried the same with this PR as well but didn't see any skip so tried to do this.

ani-skip "1P (1084 episodes)" 341
--script-opts= '--script=/home/user/.config/mpv/scripts/skip.lua'
synacktraa commented 9 months ago

I am on Manjaro, not sure if that affects but getting the following output for ani-skip and one piece, am I doing something wrong? I tried the same with this PR as well but didn't see any skip so tried to do this.


ani-skip "1P (1084 episodes)" 341

--script-opts= '--script=/home/user/.config/mpv/scripts/skip.lua'

image

update ani-skip once. sudo ani-skip -U

lasersPew commented 9 months ago

I am on Manjaro, not sure if that affects but getting the following output for ani-skip and one piece, am I doing something wrong? I tried the same with this PR as well but didn't see any skip so tried to do this.


ani-skip "1P (1084 episodes)" 341

--script-opts= '--script=/home/user/.config/mpv/scripts/skip.lua'

image

update ani-skip once. sudo ani-skip -U

This actually doesn't solve the problem. tried using One Piece instead of 1P (1084 episodes) and got the script opts: image

71zenith commented 9 months ago

works nicely (would have preferred to run it in background) about the one piece thing. im afraid there is so much we can do about it. they likely do it to not get noticed by the big corp daddies.

synacktraa commented 9 months ago

This actually doesn't solve the problem. tried using One Piece instead of 1P (1084 episodes) and got the script opts: image

If there was no error, it means there was an entry related to 1P, it's just that parsing is not working well. I'll do something about it. If it was python, we could have used vectors or ngrams to get most relevant entry.

NKTMQ commented 6 months ago

Imma test some stuff with windows and WSL.

ani-skip is working in Wsl Try gitbash too if possible

For any windows users that setup ani-cli with scoop, the likely best way is to use scoop to create a shim for ani-skip as well.

step 1 scoop install { "version": "1.0", "url": "https://raw.githubusercontent.com/synacktraa/ani-skip/master/ani-skip", "bin": "ani-skip" }

step 2 Place https://raw.githubusercontent.com/synacktraa/ani-skip/master/skip.lua Into the mpv scripts folder.

Scripts folder autoruns any lua files in it so we can ignore the "--script=$HOME/.config/mpv/scripts/skip.lua" component of the ani-skip output as mpv will ignore it (with an error message saying file not found).

Otherwise if you'd like to have the script elsewhere you can edit the ani-skip's 4th line from the scoop install to be a windows folder path instead.