ColinDuquesnoy / MellowPlayer

Moved to gitlab
https://gitlab.com/ColinDuquesnoy/MellowPlayer
GNU General Public License v2.0
234 stars 23 forks source link

Add Netflix addon #266

Closed NicolasGuilloux closed 6 years ago

NicolasGuilloux commented 6 years ago

I could be really great to add a Netflix addon. The user has to install qt5-webengine-widevine.

I already started to create it and it works well except the artwork URL. I would like to find a way to get this art but I can't find it yet. It would be great if someone can search with me. I will publish the addon as soon as it is complete. But it looks great guys ;)

Netflix MellowPlayer

What's working

What's missing

ColinDuquesnoy commented 6 years ago

That's great! Keep up with the good work 👍

I would like to find a way to get this art but I can't find it yet. It would be great if someone can search with me

Unfortunately I cannot really help you as I don't have a netflix account. If netflix doesn't offer a way to retrieve a thumbnail of the video, maybe you can use another service...

NicolasGuilloux commented 6 years ago

I can get a base64 png string but it's not working when it set "artUrl" as this string. Other links are webp or weird blob link. I will post more info on this page later. It's quite frustrating to use another service when Netflix hosts indenpendant thumbnail of the episode somewhere in the page.

Falcon caches (type netflix.falcon-caches or something like this in your console) aren't reliable. Sometimes, the information aren't stored in it but sometimes yeap. It's a weird cache ^^

Anyway, if somebody has a clue to do it...

ColinDuquesnoy commented 6 years ago

Hmm there may be a bug in the base64 decoder... Please post an example of a base64 png image you tried to use but did not work.

NicolasGuilloux commented 6 years ago

After some test, I noticed that the tag isn't always there (Sometimes yeah, sometimes nop') so I drop the idea of getting the image from the HTML. I will try to get it from maybe the Javascript if I can find a way.

Anyway, do you have an API to get an artwork from the name of a serie or film ?

NicolasGuilloux commented 6 years ago

I fixed one or two things. Not it can make the difference between a movie and serie without error.

There is still the issue about the ArtURL. I tried to fix it but I found no workaround yet. If somebody has an API to easily get a thumbnail based on the name of the serie or the film, I'm open :)

ColinDuquesnoy commented 6 years ago

@NicolasGuilloux I don't know about such an API but I have another idea/suggestion: wouldn't it be possible to grab the first frame of the video, encode it in base64 and use it for artUrl?

NicolasGuilloux commented 6 years ago

I don't think so, there are a lot of protection around the video stream with DRM stuff :/ Some people have already tried and failed. It seems really hard to get an thumbnail from the HTML.

The only possible way is from the netflix variable, but it's mostly a maze of functions inside function inside variable inside another function.

ColinDuquesnoy commented 6 years ago

Yes maybe this is not possible. I thought about this because that seems to be what the KDE Plasma Browser integration does (at least for youtube). It might be worth looking at their code, there might be some bright ideas we could reuse...

ColinDuquesnoy commented 6 years ago

@NicolasGuilloux About the artUrl issue. I looked at the logs and noticed you don't use a correct Data URI scheme when feeding MellowPlayer with base64 images (e.g. data:image/png;base64,iVB\ ORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEU\ AAAD///+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8\ yw83NDDeNGe4Ug9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAEl\ FTkSuQmCC)