Использование пакета Debian chromium-widevine

Не пытайтесь поместить вещи в каталоги, потенциально используемые другими частями системы.

Если вы единственный пользователь системы, просто установите его в $ HOME , например, в иерархии $ HOME / local . Либо это, либо используйте совершенно отдельную иерархию, основанную, например, на / opt или / sw или в другом месте (не используемом базовой системой или менеджерами пакетов).

10
16.11.2019, 22:54
2 ответа

Debian заявляет, что все пакеты, включенные в официальный дистрибутив, являются свободным программным обеспечением, но библиотеки Widevine CDM не относятся к этой категории. Однако в эталонной сборке Chrome есть двоичный объект.

0
27.01.2020, 20:03

Я обновил скрипт, найденный в Arch Linux, для загрузки и установки Widevine в хроме. Вам просто нужно обновить путь к каталогу установки хрома. Основное отличие состоит в том, что он также установит манифест, включенный в загруженный архив, и таким образом может показать версию widevine через chrome :// компоненты в хроме. Вот он:

#!/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/"
0
27.01.2020, 20:03

Теги

Похожие вопросы