Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement widevine cdm #720

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

bchen290
Copy link

Pre-flight Checklist

  1. Please remember that if you are logging a bug for some service that has stopped working or is working incorrectly, please log the bug here
  2. If you are requesting support for a new service in Ferdium, please log it here
  3. Please remember to read the self-help documentation - in case it helps you unblock yourself for issues related to older versions of recipes that were installed on your machine. (These will get automatically upgraded when you upgrade to the newer versions of Ferdium, but to get new recipes between Ferdium releases, this documentation is quite useful.)
  4. Please ensure you've completed all of the following.

Description of Change

Add Widevine support by implementing castlab electron

Motivation and Context

This would allow users to add recipes and custom websites that have DRM contents such as Spotify.
#687
#978

Screenshots

This is how Spotify should look like:
image

but currently if you add Spotify, it shows this instead:
image

Checklist

  • My pull request is properly named
  • The changes respect the code style of the project (npm run prepare-code)
  • npm test passes
  • I tested/previewed my changes locally

Release Notes

Allow Ferdium to show websites that required CDM support such as Spotify

@bchen290 bchen290 requested a review from a team as a code owner October 30, 2022 20:34
Copy link
Member

@kris7t kris7t left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I can see, the castlabs electron releases cannot be built from source (the source code published in the castlabs repo is not sufficient from building electron from scratch). In addition, it loads an explicitly closed source proprietary component (the CDM itself). This raises significant concerns with regards to transparency and user privacy.

I'd rather have the option to disable downloading and loading the CDM, or preferably, having the option of running Ferdium with an official build of Electron (as opposed to the castlabs binaries).

On a more technical side: if we want to use CDM, won't we need to add something like https://github.com/castlabs/electron-releases/wiki/EVS to our build process?

(Disclaimer: I'm also strongly opposed to any form of DRM philosophically. However, that in itself wouldn't make me opposed to this particular PR, since folks apparently want to run spotify and other streaming services in Ferdium, and they are being forced by the respective companies to install DRM modules on their computers. Nevertheless, I'd encourage such folks to support creators and buy media released DRM-free instead.)

src/index.ts Outdated Show resolved Hide resolved
scripts/build-windows.ps1 Outdated Show resolved Hide resolved
@bchen290
Copy link
Author

As far as I can see, the castlabs electron releases cannot be built from source (the source code published in the castlabs repo is not sufficient from building electron from scratch). In addition, it loads an explicitly closed source proprietary component (the CDM itself). This raises significant concerns with regards to transparency and user privacy.

I'd rather have the option to disable downloading and loading the CDM, or preferably, having the option of running Ferdium with an official build of Electron (as opposed to the castlabs binaries).

On a more technical side: if we want to use CDM, won't we need to add something like https://github.com/castlabs/electron-releases/wiki/EVS to our build process?

(Disclaimer: I'm also strongly opposed to any form of DRM philosophically. However, that in itself wouldn't make me opposed to this particular PR, since folks apparently want to run spotify and other streaming services in Ferdium, and they are being forced by the respective companies to install DRM modules on their computers. Nevertheless, I'd encourage such folks to support creators and buy media released DRM-free instead.)

If we want to support loading DRM content, there's doesn't seem to be a way around using CDM and opting into castlab's electron build originally just seemed to be the easiest. Although I do agree that it's worth looking into a way of letting the user opt into using the CDM. Maybe we don't bundle castlab's electron dependency with the project but rather have something in the settings where the user can set the Widevine library path and version?

And then we can appendSwitch from the settings like so:
https://www.electronjs.org/docs/latest/tutorial/testing-widevine-cdm#using-the-library

Would get us out of needing to use castlab's electron build and allow the user to opt into using the CDM which alleviates the transparency and user privacy a little bit.

@kris7t
Copy link
Member

kris7t commented Oct 31, 2022

opting into castlab's electron build originally just seemed to be the easiest.

It looks like the main benefit of the castlabs binaries is that they can be automatically signed for VMP: https://github.com/castlabs/electron-releases/wiki/EVS So if spotify doesn't need VMP for streaming, I guess we could still go with the original electron binaries.

Maybe we don't bundle castlab's electron dependency with the project but rather have something in the settings where the user can set the Widevine library path and version?

That could be very nice indeed! I wonder if we could still keep the auto-download aspect. E.g., the chromium-widevine package on the AUR: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=chromium-widevine just extracts the CDM from the official chrome installer, which is probably not the method officially blessed by google, for better or worse...

@bchen290
Copy link
Author

Sorry been really busy these days so if anyone else wants to pick this up, feel free to.

@victorbnl
Copy link
Contributor

Is it important to make Ferdium automatically download the required files? Qutebrowser has no settings for disabling or enabling CDM (as far as I know), it just detects whether or not the files are in the required place and uses them if they are, or do nothing if they aren’t. It’s up to the user to get the files and put them in the right place (i.e. install the aforementioned chromium-widevine on Arch). Why not replicate this behaviour?

PS: I don’t know how that would work on Windows and MacOS though

@EsmailELBoBDev2
Copy link

I'm not expert but maybe this will help? https://github.com/oscartbeaumont/ElectronPlayer#the-pain-of-widevine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants