sdaqo/anipy-cli

[Suggestion] option for reusing the video player window

Closed this issue ยท 16 comments

Currently, video player closes after each episode. I know it is intentional as anipy-cli waits for the player to close and then proceeds to fetch another link (in binge mode). In the normal mode it doesn't need to wait for the end of an episode though...

I think it would be great to have an option for using the same window over and over again (one reason for this feature could be discord streaming, which is locked on a window and closes with it).

This could be done by prefetching all/specified links (not sure if that's an option though, not sure if they expire or not) and then loading all links into some sort of playlist, which would go to the video player.

Another option that comes on mind would be creating some sort of a link between the player and anipy-cli and (on user interaction) feed it with new links.

I know what i'm suggesting is not as simple to perform, but i generally think it would be a greatly appreciated by anyone who likes to watch anime together with friends.

Thanks for taking your time to read this, even if it may be in vain.

sdaqo commented

Don't worry about it suggestions are always welcome! A interesting suggestion, I would probably use some python library to control the player, so this is possible. I will look into it.

Edit: And by the way you can use sync play to watch with your friends as well, use the -s flag

sdaqo commented

Ok, so I implemented it, go ahead and update anipy-cli. In the config there is now a new option, set it to True to use it. If you find any bugs or something that could be done better, let me know!

Wow, you're so quick. I already turned off my computer, but i'll try to wake up early and test it a bit before i'm off to vacation. Thanks again for this feature tho, it will be super duper useful.

It works really good! I had to go bughunting to find anything significant to report.

So, here are a few things i noticed:

  • mpv player no longer shows that bar at the bottom where you can seek, change subtitles etc. (probably not indended but it shouldn't be a problem, just gotta find out some of the hotkeys)
  • on every new stream the window resizes to meet the resolution of the video (not really a problem tho, just tends to be a bit annoying if someone likes to watch in a smaller window - probably can be solved by a mpv argument or something, idk)
  • if someone has an outdated personal config (missing the 'reuse_mpv_window' line), it crashes instead of falling back to the default 'False' value
  • while video is running and i try to close the mpv window, it freezes, unable to do anything with it - it will still close when quitting from anipy-cli, but will crash if you try to play another episode after trying to close it (not sure why would anyone do that tho)
  • only while config value is true, switch -v doesn't do anything (completely breaks support for VLC), a simple 'if' condition should fix that i hope. If not, then don't bother. It's not a big deal.

I didn't test Syncplay and download features, atm i have no one to test syncplay with and i don't thing anything changed in the download part of the code.

sdaqo commented

Very nice, thank you for the report.

sdaqo commented

Ok so now, I fixed all of it, except of the personal config thing, yeah it will be a bit annoying changing it every time a new option is added, but coding is more so. Moreover the mpv resizing is standart in mpv look at this mpv script it might help you: https://gist.github.com/TheAMM/5e07ad787dd95d76131b61840f403a79.
Also the seekbar now shows, on Linux that is idk about it working on windows since I don't have anything to test rn.

sdaqo commented

Alright closing this now as done.

Didn't know mpv supports lua scripts, thet's pretty cool. The resizing solution looks neat, will try that out when i get back home. That said, i'm also limited for the next week to raspbian only, but i'll set a reminder and check the navbar, out once i get home (altho i doubt it will differ from linux).

(probably unpopular opinion) Regarding the config file error, i see it as an advantage rather than a problem. At least i can get to know there are new options to play with.

So i did the classic python -m pip install git+https://github.com/sdaqo/anipy-cli to download from source. I haven't tested it much yet but i did try the seekbar. And the seekbar is indeed there... but the window persistence vanished (window acts like before, closes on video end or on episode change). And i did make sure it is still enabled in my config_personal

Also, i wanted to make sure i was running the latest version, but i couldn't find a way to check it locally (version arg isn't present and help arg doesn't show it, i also didn't find any file containing it)

You can check the version by using pip show anipy-cli

Sorry for late response, was a bit busy with irl things...

Alright, so pip show anipy-cli reports version 2.4.30 (thanks Dabbing-Guy)

  • seekbar is present, but video player is closed again everytime i change an episode or the video finishes, regardless of the 'reuse_mpv_window' setting (which, after a little testing, seems to be read correctly). So i guess having both 'remotely controllable mpv player' and 'seekbar' seems to be mutually exclusive.
  • thanks to your and player == 'mpv' addition, vlc now works even with the reuse option, unaffected. I could suggest tho, due to the nature of vlc player, i believe it is easily possible to make it work - just stop closing the vlc window (if you can). When vlc is already running, instead of creating another window, it will use the existing one (unless you use arguments to say otherwise).
  • about the mpv window freezing, because it is no longer a persistent window (thus the problem isn't present), i cannot determine if it was fixed or not

That's all from my testings, thanks again for adding my suggestion, and take care.

Ehm, not sure how notifications work on closed issues, so I'll try one last time:
This feature is not yet fixed, please at least rollback it to the previous state in which it worked (the one without seekbar)
sorry if i'm being rude but it worked well before and now i'm getting pretty much ignored.

sdaqo commented

I don't have time (and no access to a computer) right now, you can install a specific version like so: pip Install anipy-cli==version here

sdaqo commented

sorry if i'm being rude but it worked well before and now i'm getting pretty much ignored.

Don't worry but this is a open source project and no one gets paid here to do anything, we do it because we like it. Here and on other repos you should keep that in mind.

I get it, all i wanted was at least some kind of a response (wouldn't be the first time github screwed me over with notifications, so i was a bit anxious about it). If i spare some time, i could go and try to fix it myself. Altho, i'd have to learn more about github's pull requests, as i am sort of a lone wolf in coding and never used it before.
Anyways, huge thanks for your response and for your hard work on this project. And sorry once again for my anxious self.

sdaqo commented

Fixed in 2.4.31