jaruba / PowderPlayer

Hybrid between a Torrent Client and a Player (torrent streaming) -
https://powder.media/
GNU Lesser General Public License v2.1
586 stars 95 forks source link

[Nightly] Show All Subtitle Results in Menu #121

Open roeycohen opened 8 years ago

roeycohen commented 8 years ago

hi, most times, there are more than one subtitles per language and the player doesn't choose the best one. an option to manually switch between these subtitles will be really good.. as manually downloading the subtitles isn't very fun :) also, the player should remember the user's last subtitles language that was in use. i think it safe to assume that if he use the subtitles features he will use it with all videos.

i hope it's not something too complicated...

jaruba commented 8 years ago

Is this for the v0.98 version (stable version) or for the v1.00 Nightly (beta version)?

roeycohen commented 8 years ago

nightly. looking at this file: src/components/Player/workers/subtitles/find.js (63) it's seems like the last subtitle in each language overrides all previous one. may be this most simple thing to do will be using numbers: english 1 english 2 french 1 french 2 and adding a simple filtering at the menu's top.

jaruba commented 8 years ago

It doesn't choose the last subtitle, it actually uses a complex algorithm to predict the best possible subtitle for each language (a module made by @vankasteelj ).

Funnily enough, "english 1, english 2, french 1, french 2" is how some of the very first versions of Powder used to do it, it would just show all the possible results for all languages.

It's strange that I have seen a significant decrease in the number of subtitle results and also received numerous complaints as to subtitle discovery not being as good as in previous versions.

I would indeed try to make a lot more subtitle settings, one of which could be to let users select from "show best result", "show all results" as I see a need for that now, maybe even the possibility to switch between multiple subtitle discovery modules for testing purposes.

roeycohen commented 8 years ago

that would be really good :) can you please explain how the "complex algorithm" works or redirect me to it in the code?

jaruba commented 8 years ago

Although @vankasteelj would probably explain it best. I believe that the actual subtitle search is in: https://github.com/vankasteelj/opensubtitles-api/blob/master/lib/search.js

(i'm obviously using an older version of the module in the Nightly as I packaged it some time ago)

From what I remember as I worked on it a bit too, it does 3 separate searches on OpenSubtitles:

Then merges all of the results from these searches and gives a score to each subtitle by this logic: https://github.com/vankasteelj/opensubtitles-api/blob/master/lib/search.js#L200-L230

The top scoring subtitles are then selected and sent to Powder. :)

roeycohen commented 8 years ago

that's very sophisticated :) still yesterday i didn't get the right subtitle... manual selection would be really good...

besides that, what a great player!! p.s. i'm the author of bit player chrome app: https://chrome.google.com/webstore/detail/bit-player/mjkikpbeengfefopcnmhljmiobkghfpd i've found this player when i realized google is shutting down it's (packaged) app store.

vankasteelj commented 8 years ago

It's all described here : https://github.com/vankasteelj/opensubtitles-api#search-the-best-subtitles-in-all-languages-for-a-given-movieepisode

Yet to have a real match, you need to have the video file first. It works 99% of the time right from my tests, but it has trouble with less watched shows or non-US movies

roeycohen commented 8 years ago

i'll take your word for it... still it would be nice to manually choose. i know that "back in the days " of popcorn-time the wrong subtitles issue was a real pain. and it also happened to me yesterday on the first video i've tried to play with hebrew subtitles - so it must be not that uncommon.

jaruba commented 8 years ago

There's no 100% solution for anything as abstract as this, I agree that @vankasteelj 's module is the best out there, I also agree that false positives will always happen in such a scenario.

With that said, Powder was never built to be the dummy's player, quite the contrary, I always attempted to add as many options as possible for the power users. So I'll just do what I always do, implement all that I can and offer settings for people to switch between them. Then see what works best and make that the default behavior.

jaruba commented 8 years ago

Off Topic

p.s. i'm the author of bit player chrome app: https://chrome.google.com/webstore/detail/bit-player/mjkikpbeengfefopcnmhljmiobkghfpd i've found this player when i realized google is shutting down it's (packaged) app store.

@roeycohen had a chance to test out your player, it's pretty nifty, glad to find a fellow player developer and torrent enthusiast, what are your future plans in these circumstances though?

@vankasteelj missing you dude, wtf are you up to these days? give a holler whenever, would love to hear from you :)

roeycohen commented 8 years ago

@jaruba I received an email from google about the retirement of packaged apps and a recommendation to try move the program to NWJS or Electron. I was a bit disappointed about that :/ going over the lists of apps at NWJS i saw this app and i think it really cool. I don't see a good reason to start a new project that does the same while this one is clearly very good and actively developed. I hope i'll have the time to contribute to this project :) it will be a good opportunity to dive into React JS and be helpful. I also hope that one day the google dev team will allow to use tcp sockets inside the browser. that way software like this one could just be an extension or embedded inside sites.

jaruba commented 8 years ago

@roeycohen The Nightly is actually build on Electron, v0.98 (the latest stable version) is actually built on NW.js. I stopped using NW.js because their developers never answered any of the issues and did not seem to have any desire to fix anything, while the Electron devs always answer all the issues and actively fix them.

The Nightly is actually a total rewrite of Powder with Electron, React.js and Polymer. While v0.98 was just NW.js with no framework whatsoever, it was my first NW.js project and I literally treated it like making a website from scratch. :P

I also hope that one day the google dev team will allow to use tcp sockets inside the browser. that way software like this one could just be an extension or embedded inside sites.

They won't ever do that though, the fact that WebSockets wore created demonstrates that they evade making any TCP / UDP implementation, and that's understandable as it would give to much power to websites and create substantial security issues.. :(

roeycohen commented 8 years ago

well you're doing a good job :) i hope i'll be able to participate.. i know coding is consuming.

They won't ever do that though, the fact that WebSockets wore created demonstrates that they evade making any TCP / UDP implementation, and that's understandable as it would give to much power to websites and create substantial security issues.. :(

i still hope they would eventually give us the developers the option to over come these limitations without creating security holes.

vankasteelj commented 8 years ago

Something like that might happen if Microsoft or Linux decide to start shipping Node by default. Microsoft even seem heading that way with their JS engine (competitor of v8, I don't recall the name right now). Because if Node is present on 100% of the machine, it's possible some day, we start seeing in browsers the hability to natively use node if we decide to give special permissions, for example. But it's absolutely not for right now anyway x)