3

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.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Thijmen
  • 374
  • 2
  • 14

1 Answers1

1

Solution: replacing Chromiuim's default libwidevine binary with one extracted from ChromeOS.

  1. Download the latest ChromeOS libwidevine binary and extract it.

  2. Copy the extracted libwidevinecdm.so to /usr/lib/chromium-browser.

  3. Change the access permissions to 755 (chmod 755 libwidevinecdm.so)

Credits to vpetkovs's blog post for finding this bright solution.

Thijmen
  • 374
  • 2
  • 14
  • It has been a while so unfortunately I am not sure anymore. – Thijmen Nov 10 '20 at 14:35
  • Any update on this? I can't run netflix headless using python + selenium using a PI – Jefferson Santos Feb 02 '23 at 21:50
  • @JeffersonSantos the accepted answer is what worked for me. – Thijmen Feb 03 '23 at 09:11
  • What is your scenario? I have PIs (ARM64) with a python script (python + selenium). When I try to run headless with Chrome or Firefox drivers, I get the "Perdon" message. If I run in my windows PC headless with Chrome, happens the same, however, with firefox driver on win PC I can do it headless. – Jefferson Santos Feb 03 '23 at 20:58
  • It's been a while so I don't remember all the details, but I had it running on a Raspberry PI with Python and Selenium as well. – Thijmen Feb 06 '23 at 11:39