oscartbeaumont / ElectronPlayer

An Electron Based Web Video Services Player. Supporting Netflix, Youtube, Twitch, Floatplane, Hulu And More
MIT License
488 stars 93 forks source link

Netflix 1080p integration #8

Open pepper-jk opened 5 years ago

pepper-jk commented 5 years ago

Hi there,

I just came across this project and tested it quickly with Netflix. I found that it has the same problem most/any browser using widevine has. The stream is limited to 720p or in my short test case only 540p.

That is why I suggest to integrate Netflix 1080p via git submodules.

I'm not an electron/javascript/web developer, so I'm not sure how much of a hassle it is to integrate it. But since electrons core is the same as chromiums (right?) my guess it is, that it's fairly uncomplicated. At least it should be compatible in some way or another.

Let me know what you think about this. If you would consider it, but can't put the time into integrating it. I might look into it myself and send a pull request. However I might need a while to get into this.

Best regards, pepper-jk

oscartbeaumont commented 5 years ago

I will have a look into this tomorrow but it could also only be playing the low resolutions due to the old version of Electron and hence Chromium and Widevine being used. This is because the newer versions require a special licence from Widevine to use and these licences are really hard and take forever to get. I have applied for a licence but am not expecting to get even a reply. I will look into the plugin, I assume I will have to adapt the source code because Electron doesn't support Chrome plugins but if it is not to difficult I can, but I think the resolution limiting factor is the old Widevine/Chromium/Electron. I have tried other browser environments but none I tried are on par with Electron.

oscartbeaumont commented 5 years ago

If you wanted to do a PR go ahead, I would be happy to help just reach out with any questions/etc. I will have a look tomorrow but if it is too time-consuming to implement I won't be able to.

pepper-jk commented 5 years ago

This is because the newer versions require a special licence from Widevine to use and [...]

I did not know that. Sounds interesting. Do you have a reference for this?

[...] the old Widevine/Chromium/Electron. I have tried other browser environments but none I tried are on par with Electron.

Meaning Chromium and Electron lack behind Google Chrome and Firefox?

If you wanted to do a PR go ahead, I would be happy to help just reach out with any questions/etc. I will have a look tomorrow but if it is too time-consuming to implement I won't be able to.

Sounds great. So if you wont have the time, I might try it myself. If so I will get back to you about the help.

oscartbeaumont commented 5 years ago

My reference for the Widevine is the official Electron Widevine page and this Github issue on the Electron project. This Electron/Widevine issue is the roadblock for this repos issue #2. The Electron links refer to the version of Electron this project is using as requiring the licence but it is working so. Between the current Electron version of the repo and 4.0.0 they updated Chromium and I have not been able to get Widevine working even using a custom fork on electron-widevinecdm has not helped. Electron does lack behind Google Chrome but I meant Electron alternatives. I tried them for the hope that they would support Widevine better.

pepper-jk commented 5 years ago

Ah I see. Thanks for the references and the Explanation.

oscartbeaumont commented 5 years ago

It's possible it is not Widevine VMP but I don't know what else could be causing it as I have tried to do the update multiple times over the last few months, each time starting for scratch and Netflix just refuses the play the content and the Netflix error matches the issue referenced above. It is just weird I am running a later version than the Electron pages says requires VMP. It says Electron 1.8.0 but I am using Electron 3.1.7

oscartbeaumont commented 5 years ago

To integrate, you would need to adapt all of the code from the Chrome APIs to the Electon APIs. This would be fairly easy but would just take time. You would use something like mainWindow.webContents.executeJavaScript("console.log('Hello World;)"); to inject the scripts into the page and then just adapt their scripts. I do this injecting already with src/client-header.js so I would recommend you look at how I did that and how it is added to the browser window in the src/main.js file cause it will help if you are going to build this.

oscartbeaumont commented 5 years ago

Maybe give it another look now. I recently did a lot of Electron (browser) updates and that could help. It probably won't because of people needing the Chrome plugin but still.

oscartbeaumont commented 5 years ago

I am closing this issue so it doesn't clutter the issue tracker and make the repo look unmaintained as issues build up but if any progress is made/is being made I would be happy to reopen it.

pepper-jk commented 5 years ago

I'd appreciate it if you could not close unsolved issues. It makes it harder to find/be aware of past feature requests, when looking into the issues, and will most likely result in new redundant issues.

I'd suggest to use the label system. Adding the Labels "enhancement" and "help wanted" to this issue. And if you can't work on it yourself with "wontfix".

Given that the other issues will get labels as well. If someone does only want to check bugs he can filter for the "bug" label. And if someone, e.g. you, does not wanna see the "wontfix", he can filter them out as well.

In my opinion this is a much cleaner solution.

Update: Thanks. :)

actionjackbarker commented 5 years ago

is there any update on this? This would make this app a lot better

pepper-jk commented 5 years ago

Not currently. At least from my side.

I could look into it next week though, but I can't promise anything.

oscartbeaumont commented 5 years ago

Here is an attempt at getting this to work. I started and I think I ported everything important from the Chrome extension but Netflix refuses to play video. I probably made a mistake somewhere and the code requires me to disable Electron's security features (Content Security Policy) which is something that would need to be fixed before I would let it into ElectronPlayer. I am probably not going to continue working on this but hopefully, it is a helpful starting point. When I install the chrome extension in my main browser I get 480p Netflix instead of 720p which I get without so the extension, so it doesn't work for me and I really don't care enough to debug it. The repo is based off the Electron quick start code (not ElectronPlayer) with the DRM support for Mac from ElectronPlayer added. It will not work on Linux unless you change it to use the castlabs-electron like the package.linux.json file in this repo does. Contact me with any questions and even if someone could build a Poc I would be happy to integrate it into the ElectronPlayer codebase.