Atelier-Shiori / malupdaterosx-cocoa

Native MyAnimeList Scrobbler for macOS
https://malupdaterosx.moe/malupdaterosx/
BSD 3-Clause "New" or "Revised" License
24 stars 3 forks source link

Support for streamlink/livestreamer #24

Closed mlindner closed 7 years ago

mlindner commented 7 years ago

Livestreamer and streamlink are both not found by malupdaterosx. They are python applications (streamlink is a fork of livestreamer because livestreamer was abandoned). Generally people will set up livesteramer/streamlink to launch either vlc or mplayer/mpv to play the video however the title given to mpv is nonsensical so malupdaterosx cannot parse it.

Example: Command line: streamlink http://www.crunchyroll.com/saga-of-tanya-the-evil/episode-2-prologue-727461 Python execution in process list: /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python /usr/local/bin/streamlink http://www.crunchyroll.com/saga-of-tanya-the-evil/episode-2-prologue-727461 mpv execution in process list: mpv http://www.crunchyroll.com/liveplaylist/videoencode_2516221.m3u8?key=UzdEd29ZL2ZZdDdkTkRnVzJBemNmd2RpWlRnPV97ImwiOjE0NDAwLCJvIjoiZW5VUyIsInMiOjIxMTU2Mywic2xpc3QiOiJcL3ZlMjUxNjIyMVwvIiwidCI6MTQ4NDQ4NTYwMywidSI6IjkwODkzNzIiLCJ2IjoxfQ&client=com.crunchyroll.iphone

Support needs to be added to also look for "livestreamer" or "streamlink" and to parse the command line out of that process call.

moyitpro commented 7 years ago

For the time being, it will be tricky to implement since all the streaming parsing is handled by the detectstream program. Maybe if detectstream is created into a framework, I wouldn't have to handle the url parsing over again and reinvent the wheel.

For now, this is low priority.

moyitpro commented 7 years ago

Being worked on as a separate framework here. Will be implemented in the near future

moyitpro commented 7 years ago

Implemented with https://github.com/Atelier-Shiori/malupdaterosx-cocoa/commit/ffce75fa71ad9ca84e4f6465014631bb3fb36667

mlindner commented 7 years ago

So I saw your feature update. I'm confused why you had to make an entire gui to launch videos from it?

Also, the feature doesn't work for me at all. Filing a bug.

moyitpro commented 7 years ago

This is because lsof only works with open files, it cannot see the web address. Furthermore, NSRunningApplication does not contain any information with the arguments used. In short, this is the only way to implement this feature.

mlindner commented 7 years ago

As I mentioned in the other bug, you don't use lsof for this. Simply use "ps" and it shows up as a commandline parameter.

Genshiken:~ mlindner$ ps ax | grep -i crunchyroll 70508 s003 S+ 0:00.97 /usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/Resources/Python.app/Contents/MacOS/Python /usr/local/bin/streamlink http://www.crunchyroll.com/saga-of-tanya-the-evil/episode-12-how-to-use-a-victory-727483

moyitpro commented 7 years ago

In regard to detecting an existing stream, I have implemented this in the framework and I will be adding it to the program shortly

https://github.com/Atelier-Shiori/Streamlinkdetect/blob/master/streamlinkdetect/streamlinkdetector.m

mlindner commented 7 years ago

Great. Thank you very much. This is feature complete for me now at the moment for all my use cases. The only "bug" I had left (which you might have fixed already) was how it failed to detect the anime title properly. It would be at the top of the list of suggestions when I went to correct title, but it would never pick the right title the first time.