问题
I am aware that there is no official support for DRM-protected content (e.g. Spotify webplayer, netflix, etc.) when using headless chromedriver.
Has anyone here gotten it to work despite the aforementioned limitation?
I went as far as using a custom profile in headless chromedriver (one that should include WidevineCdm), but so far no luck.
回答1:
Solution: replacing Chromiuim's default libwidevine binary with one extracted from ChromeOS.
Download the latest ChromeOS libwidevine binary and extract it.
Copy the extracted libwidevinecdm.so to /usr/lib/chromium-browser.
Change the access permissions to 755 (
chmod 755 libwidevinecdm.so
)
Credits to vpetkovs's blog post for finding this bright solution.
来源:https://stackoverflow.com/questions/58477667/how-to-enable-drm-in-chromedriver-headless-mode