nativefier / nativefier

Make any web page a desktop application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nativfier issue with HBO Max

PhantomNimbi opened this issue · comments

Homework

Bug description

Attempting to play anything from HBO Max when built with nativfier displays error.

Steps to reproduce

Give your full nativefier command and its logs, with the --verbose flag, on a public site:

nativefier --name "HBO Max" "https://play.hbomax.com/" --flash --tray --conceal --widevine --enable-es3-apis --internal-urls ".*?" --background-color "#333333" --icon "C:\Native Apps\bin\resources\ico\HBO Max.ico" --verbose

Running in verbose mode! This will produce a mountain of logs and is recommended only for troubleshooting or if you like Shakespeare.

ATTENTION: Using the **unofficial** Electron from castLabs
It implements Google's Widevine Content Decryption Module (CDM) for DRM-enabled playback.
Simply abort & re-run without passing the widevine flag to default to 11.1.1

Performing async options post-processing.
Inferring user agent for electron 11.1.1-wvvmp / win32
Grabbing electron<->chrome versions file from https://atom.io/download/atom-shell/index.json
Got icon from options. Using it, no inferring needed
Got name HBO Max from options. No inferring needed
Sanitized filename for HBO Max : HBO Max
Unable to infer chrome version for user agent, using 87.0.4280.88
Given chrome 87.0.4280.88 on win32, using user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36

Preparing Electron app...
Copying electron app from C:\Users\Owner\AppData\Roaming\npm\node_modules\nativefier\app to C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5
Writing app config to C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5\nativefier.json
No files to inject, skipping copy.
Updating C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5\package.json 'name' field to hbo-max-nativefier-7b319c

Converting icons...
Building for Windows and icon is already a .ico, no conversion needed
Copying icons if necessary
Copying icon C:\Native Apps\bin\resources\ico\HBO Max.ico to C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5\icon.ico

Packaging... This will take a few seconds, maybe minutes if the requested Electron isn't cached yet...
  electron-packager Electron Packager 15.2.0
  electron-packager Node v15.6.0
  electron-packager Host Operating system: win32 10.0.19043 (x64) +0ms
  electron-packager Packager Options: {"arch":"x64","asar":true,"darwinDarkModeSupport":false,"dir":"C:\\Users\\Owner\\AppData\\Local\\Temp\\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5","electronVersion":"11.1.1-wvvmp","icon":"C:\\Native Apps\\bin\\resources\\ico\\HBO Max.ico","name":"HBO Max","out":"C:\\Native Apps\\bin\\apps\\Entertainment","overwrite":true,"platform":"win32","targetUrl":"https://play.hbomax.com/","tmpdir":false,"win32metadata":{"ProductName":"HBO Max","InternalName":"HBO Max","FileDescription":"HBO Max"}} +1ms
  electron-packager Target Platforms: win32 +3ms
  electron-packager Target Architectures: x64 +1ms
  electron-packager Requiring author in package.json, as CompanyName was not specified for win32metadata +0ms
  electron-packager Inferring appVersion from version in C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5\package.json +8ms
  electron-packager Inferring win32metadata.CompanyName from author in C:\Users\Owner\AppData\Local\Temp\nativefier-4-7-24-app--9604-z2jHJHnT6Jw5\package.json +1ms
  electron-packager Application name: HBO Max +13ms
  electron-packager Target Electron version: 11.1.1-wvvmp +0ms
  electron-packager Ignored path regular expressions: [
  '/package-lock\\.json$',
  '/yarn\\.lock$',
  '/\\.git($|/)',
  '/node_modules/\\.bin($|/)',
  '\\.o(bj)?$'
] +0ms
  electron-packager Downloading Electron with options {"platform":"win32","arch":"x64","version":"11.1.1-wvvmp","artifactName":"electron"} +0ms
Packaging app for platform win32 x64 using electron v11.1.1-wvvmp
  electron-packager Creating C:\Native Apps\bin\apps\Entertainment\win32-x64-template +10ms
  electron-packager Extracting C:\Users\Owner\AppData\Local\electron\Cache\httpsgithub.comcastlabselectron-releasesreleasesdownloadv11.1.1-wvvmpelectron-v11.1.1-wvvmp-win32-x64.zip\electron-v11.1.1-wvvmp-win32-x64.zip to C:\Native Apps\bin\apps\Entertainment\win32-x64-template +2ms
  electron-packager Initializing app in C:\Native Apps\bin\apps\Entertainment\HBO Max-win32-x64 from C:\Native Apps\bin\apps\Entertainment\win32-x64-template template +0ms
  electron-packager Ignored paths based on the out param: [
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-darwin-x64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-darwin-arm64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-linux-ia32',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-linux-x64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-linux-armv7l',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-linux-arm64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-linux-mips64el',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-mas-x64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-mas-arm64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-win32-ia32',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-win32-x64',
  'C:\\Native Apps\\bin\\apps\\Entertainment\\HBO Max-win32-arm64'
] +4s
  electron-packager Running asar with the options {} +639ms
  electron-packager Renaming electron.exe to HBO Max.exe in C:\Native Apps\bin\apps\Entertainment\HBO Max-win32-x64 +91ms
  electron-packager Running rcedit with the options {"version-string":{"FileDescription":"HBO Max","InternalName":"HBO Max","OriginalFilename":"HBO Max.exe","ProductName":"HBO Max","CompanyName":"Jia Hao"},"file-version":"1.0.0","product-version":"1.0.0","icon":"C:\\Native Apps\\bin\\resources\\ico\\HBO Max.ico"} +0ms

Finalizing build...
App built to C:\Native Apps\bin\apps\Entertainment\HBO Max-win32-x64 , move it wherever it makes sense for you and run the contained .exe file.

Expected behavior

It should play the video.

Actual behavior

Fails and displays the following error message:

Cannot play ttile
Please make sure your browser is not in private mode.

Debug info

  • Console logs of your nativefier build command, with --verbose flag
  • If the bug happens at app run time, the in-app DevTools console logs (open it with F12)
  • Error messages
  • Screenshots
  • Anything else relevant!

Context

  • Nativefier: 42.2.0
  • Node.js: 15.6.0
  • Npm: 7.4.0
  • OS: Windows 10 build 21H1
  • Is it a regression? No
  • Additional context: HBO Max uses widevine, however it seems to have the widevine plugin simply isn't working with it...

This may be an issue with widevine and HBO Max. I am also encountering this issue and looking into it the the castlabs team (who provides the widevine enabled version of Electron we use).

After talking with the Castlabs team, and experimenting on my own, I've gotten it working locally.

The problem boils down to Widevine, which allows the app to access DRM content (such as HBO Max videos). Some sites (such as HBO Max) are sticklers for WHO can access this content. In the case of HBO Max it's not good enough to be using Widevine, you must have a digitally signed app using Widevine.

Fortunately the team at Castlabs were a great help and make this pretty easy.

They've documented the process here: https://github.com/castlabs/electron-releases/wiki/EVS

As well here's what I did to make this work:

  1. Make your app as you did before (in my case I only needed --widevine in addition to the standard parameters. --flash was not necessary.
  2. Install the evs signing python package (in the steps from the document above)
  3. Sign my generated app (in the steps from the document above). One thing that slipped me up briefly is when passing your app location to the signing tool, pass it the folder that contains the app. So for me I had generated my app on Mac to ~/Downloads which created a folder called ~/Downloads/HBO Max-darwin-x64. That folder is the one I had to pass to the signing tool.
  4. After signing, launching, and signing in (fortunately I have an HBO Max login, lol), I was able to watch a show.

Sorry for the extra steps, but let me know if these work for you. If so, we'll document this a little better for future users.

@TheCleric just seeing this PR after I pushed the extra doc 😄. Reviewing.

Sorry for the late reply. been busy with a lot of things. Just wanted to touch back and say thanks for putting so much work into figuring this one out.

I can confirm updating my command to the following command works flawlessly:

nativefier --name "HBO Max" "https://play.hbomax.com/" --tray --widevine --enable-es3-apis --internal-urls ".*?" --background-color "#333333" --icon "../res/ico/hbomax.ico" && python -m castlabs_evs.vmp sign-pkg "HBO Max-win32-x64"

Thanks again for putting in so much effort to fix the issue I had with HBO Max.

Sorry for the late reply. been busy with a lot of things. Just wanted to touch back and say thanks for putting so much work into figuring this one out.

I can confirm updating my command to the following command works flawlessly:

nativefier --name "HBO Max" "https://play.hbomax.com/" --tray --widevine --enable-es3-apis --internal-urls ".*?" --background-color "#333333" --icon "../res/ico/hbomax.ico" && python -m castlabs_evs.vmp sign-pkg "HBO Max-win32-x64"

Thanks again for putting in so much effort to fix the issue I had with HBO Max.

No problem! Glad to help.