tomasmcm / SpotiWeb

Electron wrapper of play.spotify.com
Creative Commons Attribution Share Alike 4.0 International
98 stars 13 forks source link

Widevine CDM license #22

Open davejm opened 7 years ago

davejm commented 7 years ago

Hi, I've been reading that technically you shouldn't distribute Chrome's Widevine binaries as the license doesn't permit this. I was able to extract linux binaries from the Chrome installer and it works for me but I'm wondering if it would be safer to ask users to download the binaries themselves? Or provide a script.

It seems annoying and undue hassle but does anyone know the correct legal answer?

tomasmcm commented 7 years ago

@davejm Yes I know... I've never really liked doing that.

I discovered in the Chromium online source the required files for this, the problem is that I couldn't find a way to download the files... From what I found there are two solutions:

Neither one seems easy to me... Maybe you can find a way to get the files directly, here are the links I found:

Mac https://chromium.googlesource.com/chromium/reference_builds/chrome_mac/+/master/Google%20Chrome.app/Contents/Versions/37.0.2062.94/Google%20Chrome%20Framework.framework/Internet%20Plug-Ins/widevinecdmadapter.plugin Linux https://chromium.googlesource.com/chromium/reference_builds/chrome_linux/+/master/libwidevinecdm.so Linux64 https://chromium.googlesource.com/chromium/reference_builds/chrome_linux64/+/master/libwidevinecdm.so Windows https://chromium.googlesource.com/chromium/reference_builds/chrome_win/+/master/widevinecdmadapter.dll

davejm commented 7 years ago

Oh cool, I didn't know about those reference builds. Weird that you can't just download the raw file. Looking through the reference build for Mac, I can't see the 'libwidevinecdm.dylib' file. Just the adapter. This whole thing is also slightly complicated by this fact: "Note: The major version of Chrome browser [that the plugin comes from] has to be the same with the Chrome version used by Electron, otherwise the plugin will not work even though navigator.plugins would show it has been loaded." (https://github.com/electron/electron/blob/master/docs/tutorial/using-widevine-cdm-plugin.md)

tomasmcm commented 7 years ago

These are the only files we need:

And I was thinking since we need to know the version of the plugin and there is no way to get the version from the file itself, once we figure out how to download the files from googlesource we can pick a specific commit (instead of master) and always get that version, that way we don't need to worry about versions at all.

davejm commented 7 years ago

@tomasmcm Also from https://github.com/electron/electron/blob/master/docs/tutorial/using-widevine-cdm-plugin.md - "Note: Though only the widevinecdmadapter binary is passed to Electron, the widevinecdm binary has to be put aside it.". I can confirm that it stops working for me if I remove my 'libwidevinecdm.so' file. I think we need both.

Ah yes, that sounds good. It'd be slightly easier if it was hosted/mirrored on Github! By the way, I used a hex editor to search for the version of the plugin but that's probably not a good idea for the app!

davejm commented 7 years ago

Hmm I can only see the widevineadapter for the windows reference build as well. I'm not really sure now

tomasmcm commented 7 years ago

Yes... we do need both files... The thing I don't understand is why the Linux src have both files and mac and windows don't...

MAC libwidevinecdm.dylib: ? widevinecdmadapter.plugin: https://chromium.googlesource.com/chromium/reference_builds/chrome_mac/+/master/Google%20Chrome.app/Contents/Versions/37.0.2062.94/Google%20Chrome%20Framework.framework/Internet%20Plug-Ins/widevinecdmadapter.plugin

WINDOWS widevinecdm.dll: ? widevinecdmadapter.dll: https://chromium.googlesource.com/chromium/reference_builds/chrome_win/+/master/widevinecdmadapter.dll

LINUX libwidevinecdm.so: https://chromium.googlesource.com/chromium/reference_builds/chrome_linux/+/master/libwidevinecdm.so libwidevinecdmadapter.so: https://chromium.googlesource.com/chromium/reference_builds/chrome_linux/+/master/libwidevinecdmadapter.so

LINUX64 libwidevinecdm.so: https://chromium.googlesource.com/chromium/reference_builds/chrome_linux64/+/master/libwidevinecdm.so libwidevinecdmadapter.so: https://chromium.googlesource.com/chromium/reference_builds/chrome_linux64/+/master/libwidevinecdmadapter.so

davejm commented 7 years ago

I don't know either. Strange

tomasmcm commented 7 years ago

Just found this https://github.com/webcatalog/electron-widevinecdm It does not download the plugins on the client side though... so I would still be distributing the plugins in the release packages. But since they are hosting the plugins in their releases we could use it just as source. I created an issue to see if they are up to converting the src/install.js to run on client... It looks pretty active so we'll see.