使用 chromium-widevine Debian 软件包

使用 chromium-widevine Debian 软件包

至少从 Debian 9(延伸版本)开始,Debian 包含 contrib 软件包 chromium-widevine。这个包的描述是:

该软件包提供对 Widevine 内容解密模块的支持。

但是,安装此软件包后,我找不到任何 Chromium 识别或正在加载此插件的迹象。 Widevine 在这个包中的位置是/usr/lib/chromium/libwidevinecdmadapter.so

我目前使用这个包是在 Chromium 上播放 Amazon Prime Video。目前我收到错误:

您的网络浏览器缺少数字版权组件。转到 chrome://components,然后在 WidevineCdm 下单击检查更新。

chrome://components 没有列出 Chromium 下的 WidevineCdm。

对于更奇怪的是,我得到:

root@orwell:/usr/lib/chromium# ldd libwidevinecdmadapter.so 
        linux-vdso.so.1 (0x00007ffccbfad000)
        libwidevinecdm.so => not found
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f08c6e5b000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f08c6ad3000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f08c6733000)
        /lib64/ld-linux-x86-64.so.2 (0x000055e84bdbe000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f08c642b000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f08c6213000)

那么就libwidevinecdm.so一事无成吗?

知道我应该在这里做什么吗?没有chromium-widevine任何文件或指示应如何进行。

注意:这个问题至少从 Debian 10/buster 开始已经过时了,因为 chromium-widevine 软件包不再存在。

答案1

我在 debian 9.3 上使用 netflix 时运气不佳,chromium-widevine来自 contrib repo。我所做的是:

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

答案2

Debian 声明官方发行版中包含的所有软件包都是免费软件,但 Widevine CDM 库不属于此类别。有一个二进制 blob 可用Chrome 参考构建尽管。

答案3

我更新了在 Arch Linux 上找到的一个脚本,用于在 chromium 中下载并安装 Widevine。您只需更新 chromium 安装目录的路径即可。主要区别在于,它还将安装下载的存档中包含的清单,这样可以通过 chrome://components 在 chromium 中显示 Widevine 版本。这里是:

#!/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

# Set Output dir
#WIDEVINE_DIR="${WIDEVINE_INSTALL_DIR:-/opt/google/chrome}"
#WIDEVINE_DIR="${WIDEVINE_INSTALL_DIR:-/usr/lib/chromium}"
WIDEVINE_DIR="${WIDEVINE_INSTALL_DIR:-/usr/lib/chromium-browser}"

# 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" 
          WIDEVINE_INSTALL_DIR="$WIDEVINE_DIR/WidevineCdm/_platform_specific/linux_x64" ;;
    i?86) WIDEVINE_ARCH="ia32" 
          WIDEVINE_INSTALL_DIR="$WIDEVINE_DIR/WidevineCdm/_platform_specific/linux_x86" ;;
    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 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)}"
WIDEVINE_VERSION="${WIDEVINE_VERSION:-$($SILENT_DL https://dl.google.com/widevine-cdm/versions.txt | tail -n1)}"
echo latest Version: $WIDEVINE_VERSION

# 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

# Find current installed version
INSTALLED_VERSION=$(grep '"version":' $WIDEVINE_DIR/WidevineCdm/manifest.json|cut -f4 -d'"')

# Don't start repackaging if the same version is already installed
if [ $WIDEVINE_VERSION = $INSTALLED_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
  unzip "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" manifest.json 
elif available bsdtar; then
  bsdtar xf "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" libwidevinecdm.so
  bsdtar xf "${WIDEVINE_VERSION}-linux-${WIDEVINE_ARCH}.zip" manifest.json
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"
#SED_PAR="s/\"version\": \".*\"/\"version\": \"$WIDEVINE_VERSION\"/"
#if [ -e $WIDEVINE_DIR/WidevineCdm/manifest.json ]; then
#  sed $WIDEVINE_DIR/WidevineCdm/manifest.json -e "$SED_PAR" >$STAGINGDIR/manifest.json
#fi

# Escalate privileges if needed and copy files into place
#SED_PAR="s/\"version\": \".*\"/\"version\": \"$WIDEVINE_VERSION\"/"
if [ "$USER" = "root" ]; then
  install -Dm644 libwidevinecdm.so "$WIDEVINE_INSTALL_DIR/libwidevinecdm.so"
  if [ -e $STAGINGDIR/manifest.json ]; then
#     mv $WIDEVINE_DIR/WidevineCdm/manifest_neu.json $WIDEVINE_DIR/WidevineCdm/manifest.json
     install -Dm644 manifest.json "$WIDEVINE_DIR/WidevineCdm/manifest.json"
  fi
elif [ -r /etc/os-release ] && grep -qxE 'ID=((ubuntu)|(debiiian))' /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
    if [ -e $STAGINGDIR/manifest.json ]; then
      sudo install -Dm644 manifest.json "$WIDEVINE_DIR/WidevineCdm/manifest.json"
    fi
  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 manifest.json $WIDEVINE_DIR/WidevineCdm/manifest.json\""
fi

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

答案4

由于我没有找到 chromium-widevine Debian 软件包,因此我使用了替代方法“在没有 Google Chrome 的情况下单独安装 Widevine”https://github.com/proprietary/chromium-widevine?tab=readme-ov-file#alternative-install-widevine-alone-without-google-chrome

您可以使用 GitHub 中的脚本,它将检查最新的 Widevine 版本:https://dl.google.com/widevine-cdm/versions.txt并下载一个(基于您的架构 x64 或 x32),例如https://dl.google.com/widevine-cdm/4.10.2710.0-linux-x64.zip在您的 Chromium 文件夹中创建此目录结构之前(在 Debian 上它以 /usr/lib/chromium/ 开头,但它可能会根据您的 Linux 发行版而变化):

  /usr/lib/chromium/WidevineCdm
  ├── LICENSE
  ├── manifest.json
  └── _platform_specific
      └── linux_x64
            └── libwidevinecdm.so

该脚本还向文件夹添加权限 755,向文件添加权限 644。

相关内容