Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.

Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a binary blob you are taking from Chrome, so by following this guide you will have already made your distro less "pure". Also all our additions to the Chromium base are open source and our UI, while not open, is written in HTML/CSS/JS. Thus you can see exactly what we are doing (no funny business).

If you still want to run Chromium, the following explains how it is done.

Note: For ARM(hf) use this instead. Beware it requires a +2Gb download of a ChromeOS recovery image. You can actually run it on a “regular” (x86 or x86_64 Linux) PC as it will create an archive file that can be copied to the target machine.

Chromium setup

  • Install the package "chromium-codecs-ffmpeg-extra" to provide H.264/MP4 support (used by videos on Netflix). After install, you need to restart Chromium. You can confirm that it is installed and working correctly by going to http://www.quirksmode.org/html5/tests/video.html and checking that the first video listed plays.

  • Next run the script (latest-widevine.sh). This will create the file "libwidevinecdm.so" in "/opt/google/chrome".

  • Replace the "libwidevinecdm.so" provided by Chromium with a symlink to the file from Chrome:

sudo ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so 

Note: The path is typically "/usr/lib64/chromium/lib/libwidevinecdm.so" on non Debian/Ubuntu based distros.

You can confirm that DRM'd H.264/MP4 content is now playable by going to http://demo.castlabs.com/ and trying some of the demos.

Damn you Netflix!

The final complication is that Netflix does not expect pure Chromium to be able to be able play videos and hence they do a stupid thing. If they detect that Chromium is accesing a video, they point you to install Silverlight! This is particularly dumb because: you are running Linux (no Silverlight); Silverlight is an NPAPI plugin and Chrom(e|ium) only supports PPAPI. You will need to work around this.

  • Delete any cookies or data associated with Netflix. If you have failed to play videos once, then Netflix stores information about this in a cookie and you won't be able to play vidoes, even once your system is now correctly configured. Another "WTF‽" moment from the Netflix team.

  • Via a user agent editing extention or by starting Chromium with the -user-agent switch, remove the reference to "Ubuntu Chromium/XX.0.XXXX.XX", e.g.

/usr/lib/chromium-browser/chromium-browser --user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36'

Note: An extenstion is best otherwise you will need to start Chromium from the command line every time or edit the .desktop file to include this switch.

One final point. Every time Chromium upgrades it will replace the libwidevinecdm.so symlink with its own file. Thus you will need to remove it and re-create the symlink. I would also suggest re-running latest-widevine.sh at that point, to check for new versions and upgrade if needed.

#!/bin/sh
# For ARM use this instead
# https://gist.github.com/ruario/19a28d98d29d34ec9b184c42e5f8bf29
available () {
command -v "$1" >/dev/null 2>&1
}
# Make sure we have wget or curl
if available wget; then
SILENT_DL="wget -qO-"
LOUD_DL="wget"
elif available curl; then
SILENT_DL="curl -s"
LOUD_DL="curl -O"
else
echo "Install wget or curl" >&2
exit 1
fi
# Use the architecture of the current machine or whatever the user has set
# externally
ARCH="${ARCH:-$(uname -m)}"
case "$ARCH" in
x86_64) WIDEVINE_ARCH="x64" ;;
i?86) WIDEVINE_ARCH="ia32" ;;
arm*) echo "For ARM use https://gist.github.com/ruario/19a28d98d29d34ec9b184c42e5f8bf29 instead" >&2 ; exit 1 ;;
*) echo "The architecture $ARCH is not supported." >&2 ; exit 1 ;;
esac
# Set Output dir
WIDEVINE_INSTALL_DIR="${WIDEVINE_INSTALL_DIR:-/opt/google/chrome}"
# Set temp dir
TMP="${TMP:-/tmp}"
# Set staging dir
STAGINGDIR="$TMP/widevine-staging"
# Work out the latest Widevine version
WIDEVINE_VERSION="${WIDEVINE_VERSION:-$($SILENT_DL https://dl.google.com/widevine-cdm/current.txt)}"
# Error out if $CDMVERISON is unset, e.g. because previous command failed
if [ -z "$WIDEVINE_VERSION" ]; then
echo "Could not work out the latest version; exiting" >&2
exit 1
fi
# Don't start repackaging if the same version is already installed
if [ -e "$WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION" ] ; then
echo "The latest Widevine ($WIDEVINE_VERSION) is already installed"
exit 0
fi
# If the staging directory is already present from the past, clear it down and
# re-create it.
if [ -d "$STAGINGDIR" ]; then
rm -fr "$STAGINGDIR"
fi
# Stop on any error
set -eu
# Make and switch to the staging directory
mkdir -p "$STAGINGDIR"
cd "$STAGINGDIR"
# Now get the latest widevine zip for the users architecture
$LOUD_DL "https://dl.google.com/widevine-cdm/${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip"
# Extract the contents of Widevine package
if available unzip; then
unzip "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" libwidevinecdm.so
elif available bsdtar; then
bsdtar xf "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" libwidevinecdm.so
else
# The user's system has no obvious handler for Zip files. GZip can extract
# the first entry from a Zip. If libwidevinecdm.so is the first entry, we
# might just pull this off! ;)
missing_extractor_error () {
echo "Install InfoZip Unzip or BSD tar" >&2
exit 1
}
# Look in first 50 bytes for libwidevinecdm.so as it'll be mentioned there
# if it is the first entry in the zip
if head -c50 "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" | grep -Fq libwidevinecdm.so; then
# Hide the warning about multiple entries and ensure an exit code of 0
gzip -d < "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" > libwidevinecdm.so 2> /dev/null ||:
# Check that it looks like an executable
if ! file libwidevinecdm.so | grep -Fq ELF; then
missing_extractor_error
fi
else
missing_extractor_error
fi
fi
# Add version number file
touch "widevine-$WIDEVINE_VERSION"
# Escalate privileges if needed and copy files into place
if [ "$USER" = "root" ]; then
install -Dm644 libwidevinecdm.so "$WIDEVINE_INSTALL_DIR/libwidevinecdm.so"
install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION"
elif [ -r /etc/os-release ] && grep -qx 'ID=ubuntu' /etc/os-release; then
echo "Calling sudo ... If prompted, please enter your password so Widevine can be copied into place"
sudo install -Dm644 libwidevinecdm.so "$WIDEVINE_INSTALL_DIR/libwidevinecdm.so"
if [ -e "$WIDEVINE_INSTALL_DIR/libwidevinecdm.so" ]; then
sudo install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION"
else
echo "Something went wrong installing libwidevinecdm.so" >&2
exit 1
fi
else
echo "Please enter your root password so Widevine can be copied into place"
su -c "sh -c \"install -Dm644 libwidevinecdm.so $WIDEVINE_INSTALL_DIR/libwidevinecdm.so && install -Dm644 widevine-$WIDEVINE_VERSION $WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION\""
fi
# Tell the user we are done
echo "Widevine ($WIDEVINE_VERSION) installed into $WIDEVINE_INSTALL_DIR"
@dshimer

This comment has been minimized.

Show comment
Hide comment
@dshimer

dshimer Jul 15, 2016

Is there something that would need to be done on Ubuntu 16.04 besides running the script and starting Chromium?

dshimer commented Jul 15, 2016

Is there something that would need to be done on Ubuntu 16.04 besides running the script and starting Chromium?

@Goddard

This comment has been minimized.

Show comment
Hide comment
@Goddard

Goddard Jul 15, 2016

Not working with chromium...any idea on extra stuff you need to do?

Thanks

Goddard commented Jul 15, 2016

Not working with chromium...any idea on extra stuff you need to do?

Thanks

@jmauss

This comment has been minimized.

Show comment
Hide comment
@jmauss

jmauss Jul 15, 2016

Same question as Goddard, how do I get this to work with chromium?

EDIT: Sorry, just saw your response on the site. This will be pretty big for many linux users, so I want to say thanks for whipping this together. I look forward to chromium compatibility

jmauss commented Jul 15, 2016

Same question as Goddard, how do I get this to work with chromium?

EDIT: Sorry, just saw your response on the site. This will be pretty big for many linux users, so I want to say thanks for whipping this together. I look forward to chromium compatibility

@cdysthe

This comment has been minimized.

Show comment
Hide comment
@cdysthe

cdysthe Jul 15, 2016

Works well on Ubunstu 16.04. Dropped it in cron.weekly so I do not have to think about running it regularity

cdysthe commented Jul 15, 2016

Works well on Ubunstu 16.04. Dropped it in cron.weekly so I do not have to think about running it regularity

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Jul 18, 2016

@dshimer, @Goddard, @jmauss: While this works with no effort in Vivaldi, some tweaks are required to get this working in pure Chromium. I have now added a Chromium specific guide for you.

Owner

ruario commented Jul 18, 2016

@dshimer, @Goddard, @jmauss: While this works with no effort in Vivaldi, some tweaks are required to get this working in pure Chromium. I have now added a Chromium specific guide for you.

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 18, 2016

Thanks for the tutorial, works a treat! I've been meaning to do this myself some time ago and gave up shortly. I got as far as changing the user-agent and using the Chrome-variant of libwidevinecdm.so, but totally missed that Netflix stores cookies pertaining Silverlight.

Is there a specific reason why you download the RPM and not the DEB on an Ubuntu-based system? Not that it really matters, I just find it ironic.

To all the people who can't get it to work: Make sure when restarting Chromium that you close all your Chrome apps, otherwise it will keep running in the background and continue to use the old libwidevinecdm.so after you open a new browser window.

To permanently spoof the User-Agent on Netflix (on a per-site basis), you can use this extension: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg

ghost commented Jul 18, 2016

Thanks for the tutorial, works a treat! I've been meaning to do this myself some time ago and gave up shortly. I got as far as changing the user-agent and using the Chrome-variant of libwidevinecdm.so, but totally missed that Netflix stores cookies pertaining Silverlight.

Is there a specific reason why you download the RPM and not the DEB on an Ubuntu-based system? Not that it really matters, I just find it ironic.

To all the people who can't get it to work: Make sure when restarting Chromium that you close all your Chrome apps, otherwise it will keep running in the background and continue to use the old libwidevinecdm.so after you open a new browser window.

To permanently spoof the User-Agent on Netflix (on a per-site basis), you can use this extension: https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jul 18, 2016

Hey Ruarí! Thanks for the hard work.

I installed Opera in a clean VM and noticed (after installing and removing Chrome) that Opera only detected Widevine when libwidevinecdmadapter.so were present and next to libwidevinecdm.so. If any of these were missing in /opt/google/chrome/ Widevine wouldn't be detected.

After successfully Widevine detection had to workaround Netflix's user agent restriction setting it up to a Linux's Chrome, any other Chrome or browser wouldn't work.

ghost commented Jul 18, 2016

Hey Ruarí! Thanks for the hard work.

I installed Opera in a clean VM and noticed (after installing and removing Chrome) that Opera only detected Widevine when libwidevinecdmadapter.so were present and next to libwidevinecdm.so. If any of these were missing in /opt/google/chrome/ Widevine wouldn't be detected.

After successfully Widevine detection had to workaround Netflix's user agent restriction setting it up to a Linux's Chrome, any other Chrome or browser wouldn't work.

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Jul 18, 2016

Is there a specific reason why you download the RPM and not the DEB on an Ubuntu-based system?

@Torpet The script is written to be a cross distro tool, not for Ubuntu specifically. To open a deb on a non Debian based distro you need ar from binutils but that is not always installed by default on all distros. However you can extract from an rpm using only with grep, tail, a decompressor and cpio. All of these utils are pretty much universally present on every distro.

Owner

ruario commented Jul 18, 2016

Is there a specific reason why you download the RPM and not the DEB on an Ubuntu-based system?

@Torpet The script is written to be a cross distro tool, not for Ubuntu specifically. To open a deb on a non Debian based distro you need ar from binutils but that is not always installed by default on all distros. However you can extract from an rpm using only with grep, tail, a decompressor and cpio. All of these utils are pretty much universally present on every distro.

@Steffie5904

This comment has been minimized.

Show comment
Hide comment
@Steffie5904

Steffie5904 Jul 20, 2016

Hi Ruario, thanks for your script; it's fantastic!! Would you kindly please advise if the latest Vivaldi SS x64 Deb 1.3.537.5 (Developer Build) dev (64-bit) is broken for Netflix re the Widevine plugin? NF was working fine for me in V until this SS. For full context to my query here to you, pls see my posts & others' replies here; https://vivaldi.net/forum/vivaldi-browser-for-linux/9131-netflix-and-vivaldi-on-linux#68591

Steffie5904 commented Jul 20, 2016

Hi Ruario, thanks for your script; it's fantastic!! Would you kindly please advise if the latest Vivaldi SS x64 Deb 1.3.537.5 (Developer Build) dev (64-bit) is broken for Netflix re the Widevine plugin? NF was working fine for me in V until this SS. For full context to my query here to you, pls see my posts & others' replies here; https://vivaldi.net/forum/vivaldi-browser-for-linux/9131-netflix-and-vivaldi-on-linux#68591

@soykje

This comment has been minimized.

Show comment
Hide comment
@soykje

soykje Jul 25, 2016

Thx a lot for the great job @ruario! 👍 I just tried it on my Ubuntu 16.04 LTS with Vivaldi, and it worked simply and perfectly!

soykje commented Jul 25, 2016

Thx a lot for the great job @ruario! 👍 I just tried it on my Ubuntu 16.04 LTS with Vivaldi, and it worked simply and perfectly!

@siabost9deas

This comment has been minimized.

Show comment
Hide comment
@siabost9deas

siabost9deas Aug 20, 2016

Hi Ruario,

The script worked perfectly on Antergos Vivaldi on another network (my work Internet). At home on a different machine but running the same distro I get this error:

$ sudo ./latest-widevine.sh
[sudo] password for kodi: 
--2016-08-20 15:18:42--  https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Resolving dl.google.com (dl.google.com)... 216.58.210.46, 2a00:1450:4009:801::200e
Connecting to dl.google.com (dl.google.com)|216.58.210.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 49006343 (47M) [application/x-rpm]
Saving to: ‘google-chrome-stable_current_x86_64.rpm’

google-chrome-stable_   0%[                          ]       0  --.-KB/s    in 0s      


Cannot write to ‘google-chrome-stable_current_x86_64.rpm’ (Success).

It says (success) but it obviously isn't!

Many thanks.

siabost9deas commented Aug 20, 2016

Hi Ruario,

The script worked perfectly on Antergos Vivaldi on another network (my work Internet). At home on a different machine but running the same distro I get this error:

$ sudo ./latest-widevine.sh
[sudo] password for kodi: 
--2016-08-20 15:18:42--  https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
Resolving dl.google.com (dl.google.com)... 216.58.210.46, 2a00:1450:4009:801::200e
Connecting to dl.google.com (dl.google.com)|216.58.210.46|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 49006343 (47M) [application/x-rpm]
Saving to: ‘google-chrome-stable_current_x86_64.rpm’

google-chrome-stable_   0%[                          ]       0  --.-KB/s    in 0s      


Cannot write to ‘google-chrome-stable_current_x86_64.rpm’ (Success).

It says (success) but it obviously isn't!

Many thanks.

@cpw

This comment has been minimized.

Show comment
Hide comment
@cpw

cpw Sep 21, 2016

This doesn't work with chromium from debian stretch. I don't think the plugin is even enabled in the debian build.

cpw commented Sep 21, 2016

This doesn't work with chromium from debian stretch. I don't think the plugin is even enabled in the debian build.

@zauberparacelsus

This comment has been minimized.

Show comment
Hide comment
@zauberparacelsus

zauberparacelsus Oct 23, 2016

Tried this on Ubuntu 16.04 with Chromium 53. Doesn't work, doesn't even show up on about:plugins. And chromium doesn't come with a libwidevinecdm.so file.

zauberparacelsus commented Oct 23, 2016

Tried this on Ubuntu 16.04 with Chromium 53. Doesn't work, doesn't even show up on about:plugins. And chromium doesn't come with a libwidevinecdm.so file.

@jovian-od

This comment has been minimized.

Show comment
Hide comment
@jovian-od

jovian-od Jan 2, 2017

Works nicely on 16.04 and Vivaldi 1.6.689.46 (64-bit).

Ran the script and made the symlink, which of course in this case (Vivaldi instead of Chromium) was:

sudo ln -fs /opt/google/chrome/libwidevinecdm.so /opt/vivaldi/libwidevinecdm.so

Restart Vivaldi, and thats it! 👍

jovian-od commented Jan 2, 2017

Works nicely on 16.04 and Vivaldi 1.6.689.46 (64-bit).

Ran the script and made the symlink, which of course in this case (Vivaldi instead of Chromium) was:

sudo ln -fs /opt/google/chrome/libwidevinecdm.so /opt/vivaldi/libwidevinecdm.so

Restart Vivaldi, and thats it! 👍

@fulcop

This comment has been minimized.

Show comment
Hide comment
@fulcop

fulcop Jan 7, 2017

Thanks !
I was angry to boot on Windows each time I wanted to watch Canal+ (It was the only thing I needed Windows)
But I had to modify the script to also extract libwidevinecdmadapter.so
(then ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so)

fulcop commented Jan 7, 2017

Thanks !
I was angry to boot on Windows each time I wanted to watch Canal+ (It was the only thing I needed Windows)
But I had to modify the script to also extract libwidevinecdmadapter.so
(then ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so)

@sj-s

This comment has been minimized.

Show comment
Hide comment
@sj-s

sj-s Jan 19, 2017

I thought everything worked perfectly, and widevine even shows in chrome://components (Although with version number "0.0.0.0")
but whenever I attempt playing anything on netflix, I get the M7701-1003 error
https://help.netflix.com/en/node/27451

I'm running Chromium 55 on linux mint 18.1.
No user agent switch extension would work, so I made a desktop launcher from
/usr/lib/chromium-browser/chromium-browser --user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36',
but now I have no idea what went wrong.
Any help is greatly appreciated.

Thanks!

sj-s commented Jan 19, 2017

I thought everything worked perfectly, and widevine even shows in chrome://components (Although with version number "0.0.0.0")
but whenever I attempt playing anything on netflix, I get the M7701-1003 error
https://help.netflix.com/en/node/27451

I'm running Chromium 55 on linux mint 18.1.
No user agent switch extension would work, so I made a desktop launcher from
/usr/lib/chromium-browser/chromium-browser --user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.79 Safari/537.36',
but now I have no idea what went wrong.
Any help is greatly appreciated.

Thanks!

@AWildBeard

This comment has been minimized.

Show comment
Hide comment
@AWildBeard

AWildBeard Mar 6, 2017

Excellently done! Works perfect Arch Linux 3-06-17!

AWildBeard commented Mar 6, 2017

Excellently done! Works perfect Arch Linux 3-06-17!

@czcibor

This comment has been minimized.

Show comment
Hide comment
@czcibor

czcibor Apr 20, 2017

Cannot get any suggestions to work on vivaldi 1.8.770.56

czcibor commented Apr 20, 2017

Cannot get any suggestions to work on vivaldi 1.8.770.56

@lk-minot

This comment has been minimized.

Show comment
Hide comment
@lk-minot

lk-minot Apr 23, 2017

Is this workaround still working ? I have the same issue as sj-s.

lk-minot commented Apr 23, 2017

Is this workaround still working ? I have the same issue as sj-s.

@theawesomecoder61

This comment has been minimized.

Show comment
Hide comment
@theawesomecoder61

theawesomecoder61 May 27, 2017

This worked for me on Ubuntu 16.04 LTS using Vivaldi 1.9. I was hoping to use the Spotify Web Player using Vivaldi and this script worked!

theawesomecoder61 commented May 27, 2017

This worked for me on Ubuntu 16.04 LTS using Vivaldi 1.9. I was hoping to use the Spotify Web Player using Vivaldi and this script worked!

@ronnietucker

This comment has been minimized.

Show comment
Hide comment
@ronnietucker

ronnietucker Jul 23, 2017

Using Vivaldi 1.10 with Linux Mint 18.1 and after running the script (and giving it my password) then restarting Vivaldi I still don't see widevinecdn showing up on the list of components. :(

ronnietucker commented Jul 23, 2017

Using Vivaldi 1.10 with Linux Mint 18.1 and after running the script (and giving it my password) then restarting Vivaldi I still don't see widevinecdn showing up on the list of components. :(

@salim-b

This comment has been minimized.

Show comment
Hide comment
@salim-b

salim-b Jul 23, 2017

I've modified the script to also extract, copy and symlink libwidevinecdmadapter.so as mentioned by @fulcop. The modified part (from line 92 onwards) looks like this:

# Copy files into place and create necessary symlinks (escalate privileges if needed)

echo "Copying files into place and creatîng necessary symlinks ..."
if [ "$UID" = 0 ]; then
  mkdir -p "$WIDEVINE_INSTALL_DIR"
  cp * "$WIDEVINE_INSTALL_DIR"
  ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
elif [ -r /etc/os-release ] && grep -qx 'ID=\(ubuntu\|linuxmint\)' /etc/os-release; then
  echo "  Calling sudo ... If prompted, please enter your password so Widevine can be copied into place"
  sudo mkdir -p "$WIDEVINE_INSTALL_DIR"
  sudo cp * "$WIDEVINE_INSTALL_DIR"
  sudo ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  sudo ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
else
  echo "  Please enter your root password so Widevine can be copied into place"
  su -c "sh -c \"mkdir -p $WIDEVINE_INSTALL_DIR && cp * $WIDEVINE_INSTALL_DIR\""
  su ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  su ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
fi

The script works as expected, but Widevine still doesn't. Even after a restart of Chromium it still says Version: 0.0.0.0 of the Widevine Content Decryption Module under chrome://components 😕

And at least the Spotify Web Player only shows a warning about missing DRM/Widevine.

Any ideas?

salim-b commented Jul 23, 2017

I've modified the script to also extract, copy and symlink libwidevinecdmadapter.so as mentioned by @fulcop. The modified part (from line 92 onwards) looks like this:

# Copy files into place and create necessary symlinks (escalate privileges if needed)

echo "Copying files into place and creatîng necessary symlinks ..."
if [ "$UID" = 0 ]; then
  mkdir -p "$WIDEVINE_INSTALL_DIR"
  cp * "$WIDEVINE_INSTALL_DIR"
  ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
elif [ -r /etc/os-release ] && grep -qx 'ID=\(ubuntu\|linuxmint\)' /etc/os-release; then
  echo "  Calling sudo ... If prompted, please enter your password so Widevine can be copied into place"
  sudo mkdir -p "$WIDEVINE_INSTALL_DIR"
  sudo cp * "$WIDEVINE_INSTALL_DIR"
  sudo ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  sudo ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
else
  echo "  Please enter your root password so Widevine can be copied into place"
  su -c "sh -c \"mkdir -p $WIDEVINE_INSTALL_DIR && cp * $WIDEVINE_INSTALL_DIR\""
  su ln -fs /opt/google/chrome/libwidevinecdm.so /usr/lib/chromium-browser/libwidevinecdm.so
  su ln -fs /opt/google/chrome/libwidevinecdmadapter.so /usr/lib/chromium-browser/libwidevinecdmadapter.so
fi

The script works as expected, but Widevine still doesn't. Even after a restart of Chromium it still says Version: 0.0.0.0 of the Widevine Content Decryption Module under chrome://components 😕

And at least the Spotify Web Player only shows a warning about missing DRM/Widevine.

Any ideas?

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Jul 28, 2017

I have just updated the script. Anyone who was having problems of late should try again.

Owner

ruario commented Jul 28, 2017

I have just updated the script. Anyone who was having problems of late should try again.

@sblask

This comment has been minimized.

Show comment
Hide comment
@sblask

sblask Sep 29, 2017

Can't get it to work with Chromium, not even the DRM content on http://demo.castlabs.com/ plays. I am on Ubuntu 16.04

sblask commented Sep 29, 2017

Can't get it to work with Chromium, not even the DRM content on http://demo.castlabs.com/ plays. I am on Ubuntu 16.04

@theboy181

This comment has been minimized.

Show comment
Hide comment
@theboy181

theboy181 Dec 18, 2017

Im still new with Ubunto and Im lost on how to install this using SSH commands. Are there instructions that state how to get this working? I was told to gist, but I don't know how to do that.

theboy181 commented Dec 18, 2017

Im still new with Ubunto and Im lost on how to install this using SSH commands. Are there instructions that state how to get this working? I was told to gist, but I don't know how to do that.

@Jaleks

This comment has been minimized.

Show comment
Hide comment
@Jaleks

Jaleks Feb 12, 2018

For people having no write access to /opt/google/chrome/ the script might work nevertheless if you do an export WIDEVINE_INSTALL_DIR=$HOME/.local/lib/vivaldi/ in the terminal before you start the script, which should result in a per-user installation. Also libffmpeg.so could be copied to $HOME/.local/lib/vivaldi/ for a try of a per-user install, if it's not already present. (Unfortunately for libpepflashplayer.so it does at the moment not seem to be enough to do this)

Jaleks commented Feb 12, 2018

For people having no write access to /opt/google/chrome/ the script might work nevertheless if you do an export WIDEVINE_INSTALL_DIR=$HOME/.local/lib/vivaldi/ in the terminal before you start the script, which should result in a per-user installation. Also libffmpeg.so could be copied to $HOME/.local/lib/vivaldi/ for a try of a per-user install, if it's not already present. (Unfortunately for libpepflashplayer.so it does at the moment not seem to be enough to do this)

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Aug 13, 2018

If you are using a Chromium 68+ based browser, then the version of Widevine that is found will be too old. You will need to fetch one of these and install manually.

https://dl.google.com/widevine-cdm/4.10.1146.0-linux-x64.zip
https://dl.google.com/widevine-cdm/4.10.1146.0-linux-ia32.zip

EDIT

Or issue the following:

WIDEVINE_VERSION=4.10.1146.0 ./latest-widevine.sh
Owner

ruario commented Aug 13, 2018

If you are using a Chromium 68+ based browser, then the version of Widevine that is found will be too old. You will need to fetch one of these and install manually.

https://dl.google.com/widevine-cdm/4.10.1146.0-linux-x64.zip
https://dl.google.com/widevine-cdm/4.10.1146.0-linux-ia32.zip

EDIT

Or issue the following:

WIDEVINE_VERSION=4.10.1146.0 ./latest-widevine.sh
@bertdebondt

This comment has been minimized.

Show comment
Hide comment
@bertdebondt

bertdebondt Sep 16, 2018

can this script also be adapter to work for Raspberry Pi (Linux Arm) ?
Now I get: "The architecture armv7l is not supported."

bertdebondt commented Sep 16, 2018

can this script also be adapter to work for Raspberry Pi (Linux Arm) ?
Now I get: "The architecture armv7l is not supported."

@DigitalBrains1

This comment has been minimized.

Show comment
Hide comment
@DigitalBrains1

DigitalBrains1 Sep 19, 2018

So is there a known way to programmatically check for updates now for Chromium 68+? Perhaps just download the latest chrome and extract libwidevinecdm.so as Arch seems to do?

Regardless, thanks for supplying and maintaining this script!

DigitalBrains1 commented Sep 19, 2018

So is there a known way to programmatically check for updates now for Chromium 68+? Perhaps just download the latest chrome and extract libwidevinecdm.so as Arch seems to do?

Regardless, thanks for supplying and maintaining this script!

@mattst

This comment has been minimized.

Show comment
Hide comment
@mattst

mattst Oct 2, 2018

There is a bug in line 91:

sudo install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$CMDVERSION"

There is no $CMDVERSION variable, the line should be:

sudo install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION"

HTH.

P.S. Thanks for the script.

mattst commented Oct 2, 2018

There is a bug in line 91:

sudo install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$CMDVERSION"

There is no $CMDVERSION variable, the line should be:

sudo install -Dm644 "widevine-$WIDEVINE_VERSION" "$WIDEVINE_INSTALL_DIR/widevine-$WIDEVINE_VERSION"

HTH.

P.S. Thanks for the script.

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Oct 3, 2018

@DigitalBrains1

curl -sL https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df | awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'

@mattst

Thanks, not sure how I messed that up

Owner

ruario commented Oct 3, 2018

@DigitalBrains1

curl -sL https://dl.google.com/linux/chrome/rpm/stable/x86_64/repodata/other.xml.gz | gzip -df | awk -F\" '/pkgid/{ sub(".*-","",$4); print $4": "$10 }'

@mattst

Thanks, not sure how I messed that up

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Oct 5, 2018

can this script also be adapter to work for Raspberry Pi (Linux Arm)

@bertdebondt

No, because they do not offer Widevine on it's own as far as I know. There is also no Chrome to strip the binary from but there is ChromeOS. You can extract Widevine (and Flash) from a ChromeOS image and it will work with Chromium-based browsers. I have written another script to do this.

It does not work exactly like this one. Instead it fetches a suitable ChromeOS recovery image, mounts it locally and extracts out the Widevine and Flash libs, saving them in a compressed tar archive. This archive can then be extracted into place on the target ARM device.

I have done it like this so that you can run the script on a machine other than the ARM based target, given that most ARM setups have small disk drives and I need over 2Gb for the ChromeOS image alone. Of course, if you do have the space, you can run it on your ARM device directly.

Owner

ruario commented Oct 5, 2018

can this script also be adapter to work for Raspberry Pi (Linux Arm)

@bertdebondt

No, because they do not offer Widevine on it's own as far as I know. There is also no Chrome to strip the binary from but there is ChromeOS. You can extract Widevine (and Flash) from a ChromeOS image and it will work with Chromium-based browsers. I have written another script to do this.

It does not work exactly like this one. Instead it fetches a suitable ChromeOS recovery image, mounts it locally and extracts out the Widevine and Flash libs, saving them in a compressed tar archive. This archive can then be extracted into place on the target ARM device.

I have done it like this so that you can run the script on a machine other than the ARM based target, given that most ARM setups have small disk drives and I need over 2Gb for the ChromeOS image alone. Of course, if you do have the space, you can run it on your ARM device directly.

@ruario

This comment has been minimized.

Show comment
Hide comment
@ruario

ruario Oct 7, 2018

I tweaked the script a little so that it no longer requires bash and should also work on systems without InfoZip unzip or BSD tar.

Owner

ruario commented Oct 7, 2018

I tweaked the script a little so that it no longer requires bash and should also work on systems without InfoZip unzip or BSD tar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment