Widevine on chromium

Questions about software.
User avatar
ilu
Posts: 2713
Joined: 09 Oct 2013 12:45

Widevine on chromium

Postby ilu » 27 Apr 2018 20:25

I wanted to watch Netflix but the already installed widevine component wasn't recognised. It seems that debian widevine does not work. This worked:

Code: Select all

wget https://dl.google.com/widevine-cdm/1.4.8.1008-linux-x64.zip
unzip 1.4.8.1008-linux-x64.zip
sudo mkdir /usr/lib/chromium
sudo mv libwidevinecdm.so /usr/lib/chromium
sudo chmod 644 /usr/lib/chromium/libwidevinecdm.so
Please notice that, as time goes on, you will have to adjust the name of the downloaded and unzipped widevine version. You can see the current version with https://dl.google.com/widevine-cdm/current.txt . It's difficult to find the download link, so here is a script that has the relevant information: https://gist.github.com/ruario/3c873d43 ... 4d29fe37f1. It was developed for vivaldi but should be easily adapted for chromium.

The vivaldi guy says:
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:

Code: Select all

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.
...
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.
...
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.
He also recommends to spoof the user agent but I don't think that's necessary anymore. If you decide to do that use either user-agent-switcher or uMatrix by gorhill. http://techblog.willshouse.com/2012/01/ ... er-agents/ has a list of common user agents.

Just in case I'm documenting the script here for reference:

Code: Select all

#!/usr/bin/env bash

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)}

if [ "$ARCH" = "x86_64" ]; then
  WIDEVINEARCH="x64"
elif [[ "$ARCH" = i?86 ]]; then
  WIDEVINEARCH="ia32"
else
  echo "The architecture $ARCH is not supported." >&2
  exit 1
fi


# 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
VERSION=$($SILENT_DL https://dl.google.com/widevine-cdm/current.txt)

# Error out if $VERISON is unset, e.g. because previous command failed
if [ -z $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-$VERSION" ] ; then
  echo "The latest 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

set -e
mkdir -p "$STAGINGDIR"
cd "$STAGINGDIR"

# Now get the latest widevine zip for the users architecture
$LOUD_DL https://dl.google.com/widevine-cdm/${VERSION}-linux-${WIDEVINEARCH}.zip

# Extract the contents of Widevine package
if available unzip; then
  unzip ${VERSION}-linux-${WIDEVINEARCH}.zip
elif available bsdtar; then
  bsdtar xf ${VERSION}-linux-${WIDEVINEARCH}.zip
else
  echo "Install unzip or bsdtar" >&2
  exit 1
fi

# Add version number file
touch "widevine-$VERSION"

# Escalate privileges if needed and copy files into place
if [ "$UID" = 0 ]; then
  install -Dm644 libwidevinecdm.so "$WIDEVINE_INSTALL_DIR/libwidevinecdm.so"
  install -Dm644 widevine-$VERSION "$WIDEVINE_INSTALL_DIR/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-$VERSION "$WIDEVINE_INSTALL_DIR/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-$VERSION $WIDEVINE_INSTALL_DIR/widevine-$VERSION\""
fi

# Tell the user we are done
echo "Widevine ($VERSION) installed into $WIDEVINE_INSTALL_DIR"

https://gist.githubusercontent.com/ruario/3c873d43eb20553d5014bd4d29fe37f1/raw/f70f1ce62bc9e5d89dbeb56a8d67a8ce0827a4a4/Mozilla/5.0
https://gist.githubusercontent.com/

User avatar
patzy
Posts: 410
Joined: 15 Dec 2013 08:32
Location: Australia

Re: Widevine on chromium

Postby patzy » 27 Apr 2018 23:24

It didn't work for me. :cry:

User avatar
ilu
Posts: 2713
Joined: 09 Oct 2013 12:45

Re: Widevine on chromium

Postby ilu » 28 Apr 2018 00:19

I have the debian package installed - I kept it - and then just did the terminal commands, restarted chromium and it worked. What error message do you see - in terminal and from Netflix?

User avatar
patzy
Posts: 410
Joined: 15 Dec 2013 08:32
Location: Australia

Re: Widevine on chromium

Postby patzy » 29 Apr 2018 10:23

ilu wrote:
28 Apr 2018 00:19
I have the debian package installed - I kept it - and then just did the terminal commands, restarted chromium and it worked. What error message do you see - in terminal and from Netflix?
I installed chromium from the Solyd repos, so I suppose I have the debian version as well. I got no error from chromium and the usual "oops!" missing component stuff from netflix, - no detail on what is missing.
When I did the terminal commands I got no error messages.

Chromium has some updates today, I installed them but the same thing happened when I tried to watch netflix.
Nope it still didn't work.
Any thoughts on what might be 'missing'?

User avatar
ilu
Posts: 2713
Joined: 09 Oct 2013 12:45

Re: Widevine on chromium

Postby ilu » 29 Apr 2018 18:16

Login and browsing films always worked. Upon starting a film I got the message from netflix that, oops, widevine was missing although I had installed it from debian. That was fixed by extracting the widevine component from the google download and copying it via the terminal commands. Problem is that chromium has absolutely no debugging mechanism for widevine.

Maybe the recently updated chromium needs another widevine version now? There is none. I can't seem to find a proper download page. I've edited my first post, have a look again.

User avatar
ilu
Posts: 2713
Joined: 09 Oct 2013 12:45

Re: Widevine on chromium

Postby ilu » 03 May 2018 14:11

You might need to delete cookies.


Return to “Software”

Who is online

Users browsing this forum: No registered users and 4 guests