As of 3-30-2020, if you want the “paste-one-line-it-just-works” go to:

http://blog.vpetkov.net/2020/03/30/raspberry-pi-netflix-one-line-easy-install-along-with-hulu-amazon-prime-disney-plus-hbo-spotify-pandora-and-many-others/

^^^ PLEASE USE POST USING ABOVE LINK FOR MY “ONE-LINE IT JUST WORKS” ^^^
(IGNORE EVERYTHING BELLOW THIS AS IT’S THE ORIGINAL DEVELOPMENT WORK)

This was my initial “netflix on the raspberry pi 4 development” blog post. Leaving it on here due to the comments, initial work, info for those interested, but I highly recommend using the easy method above (linked).

Last libwidevine extract: 3-29-2020 – v.4.10.1610.6 of libwidevine – EVERYTHING CONFIRMED WORKING


Chromium has made substantial changes the way libwidevine (and a few major things around DRM) are loaded/used/etc. They have also made changes to the setting and reading of the user-agent propagation. For some time (~2 months or so) — the combination of this badly broke Netflix. It seems they have undone the lib loading in the last couple of versions, and user @Spartacuss discovered the user-agent fix.

The instructions here (as of 3-29-2020) work for: Netflix, Hulu, HBO, Disney+, Amazon Prime, Spotify, Pandora, and many others.

The Raspberry Pi 4 model with 4GB of RAM is the first cheap hardware that can provide a real “desktop-like” experience when browsing the web/watching Netflix/etc. However, if you have tried to run Netflix on the Pi, you have quickly entered the disgusting mess that exists around DRM, WideVine (Netflix being one example of something that needs it), and Chromium.

After hours and hours of effort, I finally discovered a quick and elegant solution that lets you use the latest default provided Chromium browser, without having to recompile anything in order to watch any WideVine/DRM (Netflix, Spotify, etc) content.

Background and the DRM Problem

If you are not familiar with this, the short version is that Netflix (and many others, ex: Spotify) use the WideVine “Content Protection System” – aka DRM, and if you want to watch Netflix or something else that uses it, you need to have a WideVine plugin+browse supported integration. Chrome, Firefox, and Safari make it available for x86/amd64 systems, but not for ARM since technically they don’t have ARM builds.

Chromium, the project Chrome is based on, does have an ARM build, but it does not include any DRM support, and technically it does not include widevine support by default (*caveat here, which helps us later)
So long story short, the question becomes “how do you enable DRM/WideVine support in Chromium?”.

It seems there are two main solutions out there: use an old (v51, 55, 56, 60) version of Chromium which has been “patched” with widevine support (kusti8’s version seems to be the most popular one – except since the new Netflix changes, that also does not work), which requires uninstalling the latest Chromium available, installing the old/patched one, and dropping in older widevine plugins; the second option is to use Vivaldi – a proprietary fork of Opera which also has been “sort of patched”, but it still needs a valid libwidevinecdm plugin (see bellow) and it has it’s own issues (and also…it’s Opera…in 2019…who uses Opera?)

After a lot of research and trial and error, I discovered a much more elegant solution – use the extracted ChromeOS (armv7l – yay) binaries and insert them into Chromium + make everything think it’s ChromeOS (user agent)

Netflix/Hulu/Spotify with the Default Raspberry Pi Chromium Browser

Enough theory – let’s do this in 2 quick steps!
0.) If you have tried Netflix/etc already, open Chromium and clear your browser history + cookies. Otherwise it will cache the “failed” DRM components.

1.) Download the latest extracted ChromeOS libwidevine binary and extract it:

NOTE: Credit and thanks to @Spartacuss for discovering user-agent method with .desktop file!

NOTE: You can verify that these are the *official* versions from ChromeOS:
https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_12739.105.0_elm_recovery_stable-channel_mp-v2.bin.zip

NOTE: UPDATED (Last re-extracted from ChromeOS on: 3-23-20)
version: 4.10.1610.6 (see optional script below how to check version)
filename: libwidevinecdm.so
md5sum: 6857e5f102651bfa977eb739b86bf75e
sha256sum: 678c21b5ebf459919f9dcde100af8f59e580b6bed56b1cae1ae5eb43a7029e17

2.) Completely QUIT all Chromium windows.
Start Chromium with the new Application Menu under “Internet”: Chromium (Media Edition)
Open a new tab, and go to: https://bitmovin.com/demos/drm You should be able to see the movie on the left. (While this still works, it will show “No DRM” unless you set the Chromium user-agent from within the app – which breaks Netflix. BitMoving unfortunately looks for that first. Just go to Netflix/Your media source directly.)
You can now play Netflix, Hulu, HBO, Spotify, Pandora, Disney+, Amazon Prime, and many others!

Please note that If you can see the video on the left, this means the DRM plugin has worked! From this point on, anything that does not work (ex: Netflix sometimes breaks after a browser update) is due to the site specifically filtering User Agents/doing other “tricks”. So for example, if Netflix does not work, Spotify, Pandora, Hulu, Amazon Prime, HBO, etc will still work. The BitMovin website is the “real” test on wether the DRM plugin has worked.(While still technically true, if your Chromium user-agent is not set from within the app itself, which breaks Netflix, BitMovin will show “No DRM” even though the DRM decryption works)

Solution for the occasional “screen tearing”

Updated: 4-7-2020

It seems the Pi’s raw CPU frequency is still not powerful enough for decoding 100% of the time. While 97-98% of the time is good enough, you will get the occasional “screen tearing” (https://en.wikipedia.org/wiki/Screen_tearing), especially in scenes with fast motion.

Users Otaku, DM (and thanks to Luca for testing/extra info!) have found a solution which was mentioned on https://lb.raspberrypi.org/forums/viewtopic.php?t=246179 by user Greysvandir.
I had to add a few more things and I created a compressed and slightly automated 😉 version:
# sudo apt install -f compton
$ mkdir -p ~/.config/lxsession/LXDE-pi
$ cd ~/.config && wget https://raw.githubusercontent.com/dastorm/Compton-xfce-config/master/compton.conf
$ cp -f /etc/xdg/lxsession/LXDE-pi/autostart ~/.config/lxsession/LXDE-pi/autostart
$ echo “@usr/bin/compton –backend glx” >> ~/.config/lxsession/LXDE-pi/autostart
$ echo “xrandr –output HDMI-1 –mode 1280×720” >> ~/.config/lxsession/LXDE-pi/autostart
The result is no tearing with 1080p@60fps video.

(OPTIONAL) Get libwidevinecdm version
If you want to check your *actual* libwidevinecdm version, the easiest and quickest way is using user VMX’s elegant python solution:

This will give you the version:
4.10.1610.6

Alternatively, if for some reason you want to, you can compile a binary (C) checker by:

a.) Create a file called “get_cdm_version.c with:

b.) Compile the binary with: gcc get_cdm_version.c -o get_cdm_version -ldl

If you want a binary version for some reason (I don’t know why you would given python method), and you can’t compile it yourself, and you trust me (why?!), feel free to grab my already compiled version:

c.) Place a copy of the libwidevinecdm.so in the same directory as your binary
d.) Run it

^^ Here the Version is: 4.10.1610.6

(OPTIONAL: Older Versions)
Here are the last few OLDER versions in case you need them (note the unique date in the url):

http://blog.vpetkov.net/wp-content/uploads/2019/08/libwidevinecdm.so_.zip
http://blog.vpetkov.net/wp-content/uploads/2019/07/libwidevinecdm.so_.zip

273 Thoughts on “Netflix and Spotify on a Raspberry Pi 4 with Latest Default Chromium

  1. Oh … my … god … This solves a problem that existed since the middle ages: watching Yelo Play from the Belgian cable provider Telenet in Belgium on a RapsberryPi. Thanks a million!

    • Ventz on May 24, 2020 at 10:05 pm said:

      Tom – thanks 🙂 – it’s always awesome to read stuff like this! If you can, please post about it wherever you struggled to find a solution before.
      I keep hearing from users that they have tried a few other things before this one, which tells me this is not ranking properly on google 🙂

      Thanks!

  2. Hi. Is this supposed to work on a raspberry pi 3b ? I followed multiple tutorials and techniques, and after painful hours I only managed to get Amazon Prime Video working on Vivaldi only. Netflix doesn’t work in all my browsers. When I use the libwidevine.so linked here and the user agent specified in the .desktop file, on Chromium, Netflix, I get error C7361-1254 , which apparently is a ChromeOS specific error, but I have no idea how to fix it.

    • Ventz on May 22, 2020 at 10:22 am said:

      Nim – Yes, it works on the 3b. Did you see the link at the top of this page? (please use the other post with the “1-line”)

      • Yes, I have tried. Unfortunately, the exact same error appears..
        “Sorry, we are having trouble with your request”, error code C7361-1254. The weird thing is, why would prime video work, but not Netflix… Maybe Netflix use additional protection? Or an even newer libwidevine.so that doesn’t even exist in the latest ChromeOS yet?

        • Ventz on May 22, 2020 at 1:52 pm said:

          Are you running Raspbian 10 (latest)? I haven’t tested on a Pi 3 in a while personally, but a few users just posted in the past 24 hrs that they have it working on the 3b from the 1-line approach

  3. Rafafa on May 20, 2020 at 7:24 am said:

    It works, although in Netflix the resolution was reduced to 960×540.

    Does I have to edit something, like the user agent, to play it at 1080p?

    • Ventz on May 22, 2020 at 10:23 am said:

      Rafafa – the x540 is strange. Google/CrOS restricts the “width” resolution, so you cannot do 1080p (thus 960), but I believe the height should be far larger, unless you have a strange monitor 🙂

  4. William E. Briggs Jr. on May 19, 2020 at 3:54 pm said:

    Thankyou for this media fix. The last problem I have is using Bluetooth headphones to play any media accessed via chromium. They work fine playing media on the VLC Media Player.

  5. Pingback: 15 Best Raspberry Pi 4 Projects You Can Build – TRM Security Digest

  6. soyuzz on May 12, 2020 at 3:42 pm said:

    I’m using raspbian and it works with spotify, but it doesn’t work with apple music or amazon mussic

    • Ventz on May 17, 2020 at 1:46 am said:

      soyuzz – Thanks for the info. I haven’t tried with apple music or amazon music (don’t have accounts with either). What errors/messages do you get with those services? Trying to see if they are looking for a different DRM plugin or it’s just that they don’t work with Chromebooks yet as they are not fully html5.

  7. Guido on May 5, 2020 at 5:38 am said:

    Great! This works for me too on Raspbian on the Pi4! Thank you!!!

    I read some of the comments here, and did a check on the binary and indeed it looks it like it’s coming straight from Google 🙂

  8. I tried multiple other browsers and write ups, and nothing worked. Found this one, and worked the first time. Thank you for the write up.

  9. Mike on May 1, 2020 at 11:51 pm said:

    Exactly what I was looking for, thanks for the post.

  10. JacLIL on April 29, 2020 at 8:44 am said:

    Hi.

    I managed to complete stage 1, installing libwidevine. This gave me Chromium media edition. However, neither Netflix or spotify works. To be fair, I’m completely new to raspberry pi, and linux in general. 🙂 How do I “unless you set the Chromium user-agent from within the app – which breaks Netflix. BitMoving unfortunately looks for that first. Just go to Netflix/Your media source directly.)” ???

    • JacLIL – the Media edition should be the second step. Open the terminal, and try setting the “–user-agent=…” for chromium manually…if that works, you are all set. Is there a reason you are doing this manually vs using the 1-line installer with the latest Raspberry Pi Buster image?

  11. First of all – great article! Works for Netflix, Hulu, Disney+, Amazon Prime, and Movies AnyWhere (Vudu). For some reason Vudu would not work – told me the video format was unsupported, however, when I used MoviesAnywhere to host my Vudu account, my Vudu collection works great.

    Not sure why, but Locast will not play local TV channels on Chromium Media Version, but they will play fine on FireFox ESR. On the other hand, I haven’t found anyway to stream from my xFinity account. Tried Opera as well, so that is the only streaming service I don’t have on my Raspberry Pi 4b with 4 Gig, overclocked at 2000 with the GPU overclocked at 800.

    So, to summarize, I have two identical systems set up for twin daughters – they never watch TV anymore, and I uninstalled KODI since these streams were 95% of the reason for KODI in the first place – THANKS!!!

    • Jess – great to hear. XFinity is one where it will not work, because believe it or not, they still use flash. They are milking the whole “chrome-end-date” thing until the last possible date. Until they change to html5/drm, it will not work.
      You could add the flash plugin (I do have it extracted too), but it’s not worth it imo – other than opening yourself up to security issues potentially, it will be a pain to keep getting it working.

      I haven’t used Vudu, but good to know there is a way via MoviesAnywhere.

  12. That’s super, thank you very much!

    I tried the same in Manjaro on the Raspberry Pi, but didn’t get it to work with Spotify.

    The paths in Manjaro are slightly different, i.e. I copied the lib into: /usr/lib/chromium and adapted the start command accordingly. Nonetheless Spotify won’t play.

    Do you know, why that is?

    • Ben – I don’t have any experience with Manjaro. Assuming the X/composer display is the same (or that aside), the way you can “port” this is to find your Chromium launcher in Majaro, clone it, and modify it to give it the user-agent as a startup parameter to the launcher itself.
      You will probably have to do the launcher itself in the Manjaro format.

    • Max on May 2, 2020 at 4:58 am said:

      I had the same problem:
      You have to use “chromium-browser” package not the “chromium” package to use the “libwidevinecmd.so” package.
      Get rid of the “chromium” package completely and install the “chromium-browser” package if available. Do all the steps and it should work. If the user-agent paramenter is not accepted (which was in my case) you can try to use the extension “user-agent-switcher” by “esolutions.se” (that is the only one which works flawlessly). Make a custom user-agent with the settings provided in the .desktop file.

    • Don Isenstadt on May 9, 2020 at 6:06 am said:

      Hello,
      I used the one line install on buster with raspberry pi 4 2GB.
      It worked perfectly but around 30 minutes into a movie on Disney+ it froze. I was able to stop the browser then logon again and resume where I left off.
      Again the playback was fine until it wasn’t after another 30 minutes. I haven’t seen anyone else having this problem on your blog.
      Could it be heat related? Or does it need 4GB to run?
      Thanks again for creating this.

      • Ventz on May 10, 2020 at 2:09 am said:

        Don – thanks for the info. Does it happen consistently around 30 mins? (more than once?). Same movie/show and at the same place?
        I’ve noticed that the DisneyPlus player for the web is not “perfect” yet…it does have some issues.

        It’s possible that it’s ram related since 2GB is not a lot, and depending on your GPU allocation, and the OS, you end up with less than 1GB for the application…and Chromium is very memory hungry.

  13. Does anyone else have problems with Netflix where some sections of the screen kind of get overlayed when things move and some parts get suck? Hard to describe. Not the same as tearing. Is there a solution for this?

  14. Astrinus on April 17, 2020 at 3:25 pm said:

    I followed your instruction a month ago and all worked well (except that I found a libwidevinecdm.so in the subdir libs that has the same hashes as yours).
    It worked until yesterday, tonight Netflix gives error C7399-1260-00000025 which is not documented in their help center.

    • Ventz on April 18, 2020 at 3:36 pm said:

      Please use the 1-step method. It does everything for you, and confirmed as of last night (4/17), still works. If you can, please reinstall with a clean version of Raspbian Buster (latest). A lot has changed all around, and latest raspbian + the 1-line install will be by far the easiest way to get everything working.

      • Astrinus on April 19, 2020 at 8:55 am said:

        After an hour I found the new user-agent in the comments, just switching to the new worked. I could not edit the comment to tell you. In the 1-line you have the old user-agent.

        • Astrinus – the user agent doesn’t need to be on the latest. Just one thats supported as a “ChromeOS” trigger by Netflix. You really want libwidevin on the latest version due to the significant improvements. In general, if you want to do this manually (for security, trust, etc) – at least pull apart the 1-line method and configs so that you have a supported version, because it will be very hard to debug when it breaks again. This is what I am trying to prevent via the 1-line method (other than ease), a supported and consistent way for everyone to be on the same page so if Netflix/Chromium/libwidevine changes something, rerunning the 1-line will always patch the right issue.

          • Astrinus on April 20, 2020 at 1:37 am said:

            Maybe Netflix in my region (an European country) has a different check on user-agent.
            Libwidevine is 4.10.1610.6 (checked), old user-agent do not work, new works like a charm. I do not have old Raspbian crust because the SD was loaded in March with the latest one.

  15. To get the version of shared library you could also use Python, so one needed to compile something or trust you 😉
    This one-liner works with Python2 and 3.

    • Ventz on April 16, 2020 at 7:19 pm said:

      vmx – Thanks for providing it. I’ll updated the blog post.

      Coming from 15+ years of security forensics, incident response, and security+non-security architecture work, I have some of the largest appreciation against the “hey run this random binary that works — I promise it’s safe” approach.

      This is why I have gone out of my way to make sure everything is completely open/transparent everywhere possible, and at least verifiable-able/end-user create-table everywhere non-open sourced.

      This whole project started with 2 needs:
      1.) getting Netflix on the pi *easily* and quickly.
      and specifically
      2.) without using a “custom built browser” that was built and “version pinned”, so you could not even update it with the latest security patches.

      When I started, the only non-custom OS “solution” (and not working at the time) was by a random person on the internet who had built a binary of an old chromium version that was statically compiled with some libraries, and everything was completely closed sourced. For all I knew, he could have had a keystroke/password logger built in.

      Everything I have is open/transparent and available to verify, including the 1-line automation shell script:
      https://pi.vpetkov.net

      and even the “non-open source” stuff, to the best of our ability:

      • Hello Ventz,

        I’m sorry.
        I just tested your script and it gave me following error.

        Invalid configuration file for working environment ‘/usr/share/applications/chromium-media-browser.desktop’

        Did i do something wrong?
        Your script finisched just fine without any error …
        But i exectuted it as a normal user. No root nor sudo rights.

        The file looks ok to me.
        But i’m not a specialist 🙂

        • Ventz on April 21, 2020 at 8:59 am said:

          Tom – are you using Raspbian? It should run as a normal user, but it should prompt you for sudo/escalated privs for the parts that it needs to drop in system directories.

          • You are right! It works perfectly! My bad.

            Just a bummer what ik wanted to watch is to heavy for the pi.
            I live in Belgium. We have an isp called Telenet who has an online tv watch service.
            I overclocked the pi for 200%. Some channels are playing but most of them are glitching all te time.
            Some do play perfectly. but most push the 4 cores straight to 95 – 100%

            I also tried to compile the popcorntime source from many places i found.
            Also no succes. Tried littery everything. npm, bower, yarn, …

            So i guess the pi4 is good to plays movies.
            But not really the multimedia device i hoped for 🙁

            Thx for your reply!!

Comment navigation

 

Leave a Reply

Your email address will not be published. Required fields are marked *

>> NOTE: Please use <code>...</code> to post code/configs in your comment.

Post Navigation