diff --git a/README.md b/README.md index c821e10..8bb94ce 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,56 @@ The following script symlinks Google Chrome's Widevine library to Chromium's dir Paste this into your terminal: +For linux + +```bash +git clone https://github.com/amidevous/chromium-widevine.git && \ + cd chromium-widevine && \ + sudo ./use-from-google-chrome.sh +``` + + ```bash -git clone https://github.com/proprietary/chromium-widevine.git && \ +wget https://github.com/amidevous/chromium-widevine/archive/refs/heads/master.tar.gz -O master.tar.gz && \ + tar -xvf master.tar.gz && rm -f master.tar.gz && \ + cd chromium-widevine-master && \ + sudo ./use-from-google-chrome.sh +``` + + +```bash +git clone https://github.com/amidevous/chromium-widevine.git && \ cd chromium-widevine && \ - ./use-from-google-chrome.sh + sudo ./use-standalone-widevine.sh +``` + + + +```bash +wget https://github.com/amidevous/chromium-widevine/archive/refs/heads/master.tar.gz -O master.tar.gz && \ + tar -xvf master.tar.gz && rm -f master.tar.gz && \ + cd chromium-widevine-master && \ + sudo ./use-standalone-widevine.sh +``` + +For Windows Require and use on Cygwin Terminal (https://cygwin.org) + +install https://cygwin.org/setup-x86_64.exe + +minimal require package add wget, gzip, tar + +open Cygwin Terminal in Admin Mode Require + +enter command + +```bash +wget https://github.com/amidevous/chromium-widevine/archive/refs/heads/master.tar.gz -O master.tar.gz && \ + gunzip master.tar.gz && tar -xvf master.tar && rm -f master.tar && \ + cd chromium-widevine-master && \ + ./use-standalone-widevine-windows.sh ``` + ## Test Widevine Paste into terminal (*warning: restarts Chromium*): @@ -61,9 +105,9 @@ killall -q -SIGTERM chromium-browser || \ Paste this into your shell: ```bash -git clone https://github.com/proprietary/chromium-widevine.git && \ +rm -rf chromium-widevine && git clone https://github.com/amidevous/chromium-widevine.git && \ cd chromium-widevine && \ - ./use-standalone-widevine.sh && \ + sudo ./use-standalone-widevine.sh && \ killall -q -SIGTERM chromium-browser || \ killall -q -SIGTERM chromium && \ exec $(command -v chromium-browser || command -v chromium) ./test-widevine.html & diff --git a/fetch-latest-widevine-windows.sh b/fetch-latest-widevine-windows.sh new file mode 100644 index 0000000..ecb6550 --- /dev/null +++ b/fetch-latest-widevine-windows.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Detect wget/curl +DLTOOL="" +which wget && DLTOOL="wget -O -" +which curl && DLTOOL="curl -L" +[[ -z ${DLTOOL} ]] && echo "No download tool found on this system" 1>&2 && exit 1 +VERSION=$(${DLTOOL} https://dl.google.com/widevine-cdm/versions.txt | tail -n1) +[[ -z ${ARCH} ]] && echo "Architecture not supported" 1>&2 && exit 1 +# Begin download +# Fix download argument for wget +DARG=${@} +[[ ${DLTOOL} == "wget -O -" ]] && DARG=`echo ${DARG} | sed 's/\-o /\-O /'` && DLTOOL="wget" +${DLTOOL} ${DARG} "https://dl.google.com/widevine-cdm/${VERSION}-win-x64.zip" diff --git a/fetch-latest-widevine.sh b/fetch-latest-widevine.sh index 5d31ffe..ff8e428 100755 --- a/fetch-latest-widevine.sh +++ b/fetch-latest-widevine.sh @@ -1,25 +1,26 @@ #!/bin/bash +# Detect wget/curl +DLTOOL="" +which wget && DLTOOL="wget -O -" +which curl && DLTOOL="curl -L" +[[ -z ${DLTOOL} ]] && echo "No download tool found on this system" 1>&2 && exit 1 + # Set ARCH variable ARCH="" case `uname -m` in i?86) ARCH="ia32" + VERSION=$(${DLTOOL} https://dl.google.com/widevine-cdm/versions.txt | tail -n10 | head -1) ;; x86_64) ARCH="x64" + VERSION=$(${DLTOOL} https://dl.google.com/widevine-cdm/versions.txt | tail -n1) ;; esac -[[ -z ${ARCH} ]] && echo "Architecture not supported" 1>&2 && exit 1 - -# Detect wget/curl -DLTOOL="" -which wget && DLTOOL="wget -O -" -which curl && DLTOOL="curl -L" -[[ -z ${DLTOOL} ]] && echo "No download tool found on this system" 1>&2 && exit 1 +[[ -z ${ARCH} ]] && echo "Architecture not supported" 1>&2 && exit 1 # Begin download -VERSION=$(${DLTOOL} https://dl.google.com/widevine-cdm/versions.txt | tail -n1) # Fix download argument for wget DARG=${@} [[ ${DLTOOL} == "wget -O -" ]] && DARG=`echo ${DARG} | sed 's/\-o /\-O /'` && DLTOOL="wget" diff --git a/find-chromium-windows.sh b/find-chromium-windows.sh new file mode 100644 index 0000000..e07fd01 --- /dev/null +++ b/find-chromium-windows.sh @@ -0,0 +1,12 @@ +#!/bin/bash +if [ -d "/cygdrive/c/Program Files/chromium" ]; then + CHROMIUM_DIR="/cygdrive/c/Program Files/chromium" +elif [ -d "/cygdrive/c/Program Files/chromium-browser" ]; then + CHROMIUM_DIR="/cygdrive/c/Program Files/chromium-browser" +elif [ -d "/cygdrive/c/Program Files (x86)/chromium" ]; then + CHROMIUM_DIR="/cygdrive/c/Program Files (x86)/chromium" +elif [ -d "/cygdrive/c/Program Files (x86)/chromium-browser" ]; then + CHROMIUM_DIR="/cygdrive/c/Program Files (x86)/chromium-browser" +fi +echo $CHROMIUM_DIR + diff --git a/find-chromium.sh b/find-chromium.sh index 78849e5..26f72be 100755 --- a/find-chromium.sh +++ b/find-chromium.sh @@ -1,5 +1,6 @@ #!/bin/bash + # Find Chromium and its library directory if ! [ -x "$(command -v chromium)" ] && ! [ -x "$(command -v chromium-browser)" ]; then @@ -11,6 +12,20 @@ $ sudo apt install chromium or Ubuntu: $ sudo apt install chromium-browser +or +Centos Red Hat Entreprise Alma Linux or Other fork: +require enable RPM Fussion https://rpmfusion.org/Configuration +$ sudo yum -y install epel-release +$ sudo yum -y install --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm +$ sudo yum -y update +$ sudo yum install chromium +or +Fedora: +require enable RPM Fussion https://rpmfusion.org/Configuration +$ sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm +$ sudo dnf -y update +$ sudo dnf install chromium + EOF exit 1 fi @@ -21,6 +36,9 @@ if [ -d /usr/lib/chromium ]; then elif [ -d /usr/lib/chromium-browser ]; then # Ubuntu CHROMIUM_DIR=/usr/lib/chromium-browser +elif [ -d /usr/lib64/chromium-browser ]; then + # Fedoara or Centos or Red Hat Entreprise or Other fork + CHROMIUM_DIR=/usr/lib64/chromium-browser elif [ -d $HOME/snap/chromium/current/.local ]; then # Snap mkdir -p $HOME/snap/chromium/current/.local/lib @@ -30,6 +48,7 @@ else Where is lib/ for chromium installed? Couldn't find it on the normal paths like: /usr/lib/chromium /usr/lib/chromium-browser +/usr/lib64/chromium-browser $HOME/snap/chromium/current/local/lib Edit ./find-chromium.sh and set CHROMIUM_DIR to that directory. @@ -38,3 +57,4 @@ EOF fi echo $CHROMIUM_DIR + diff --git a/use-standalone-widevine-windows.sh b/use-standalone-widevine-windows.sh new file mode 100644 index 0000000..0f40f7b --- /dev/null +++ b/use-standalone-widevine-windows.sh @@ -0,0 +1,36 @@ +#!/bin/bash +CHROMIUM_DIR="$(/bin/sh ./find-chromium-windows.sh)" +if [ -z "$CHROMIUM_DIR" ]; then + exit 1 +fi + +# Get Widevine archive +/bin/sh ./fetch-latest-widevine-windows.sh -o ./widevine.zip +# Expected directory structure: +# widevine.zip +# ├── LICENSE.txt +# ├── manifest.json +# └── widevinecdm.dll +# └── widevinecdm.dll.sig +# └── widevinecdm.dll.lib + +# Extract Widevine and recreate this directory structure under the Chromium directory: +# /usr/lib/chromium/WidevineCdm +# ├── LICENSE +# ├── manifest.json +# └── _platform_specific +# └── win-x64 +# └── widevinecdm.dll +# └── widevinecdm.dll.sig +# └── widevinecdm.dll.lib + +mkdir -p "$CHROMIUM_DIR/WidevineCdm/_platform_specific/win-x64/" +cd "$CHROMIUM_DIR/WidevineCdm/" +unzip widevine.zip +mkdir -p "${CHROMIUM_DIR}/WidevineCdm/LICENSE/" +mv LICENSE.txt "${CHROMIUM_DIR}/WidevineCdm/LICENSE/" +mv widevinecdm.dll "$CHROMIUM_DIR/WidevineCdm/_platform_specific/win-x64/" +mv widevinecdm.dll.sig "$CHROMIUM_DIR/WidevineCdm/_platform_specific/win-x64/" +mv widevinecdm.dll.lib "$CHROMIUM_DIR/WidevineCdm/_platform_specific/win-x64/" +# clean up +rm ./widevine.zip diff --git a/use-standalone-widevine.sh b/use-standalone-widevine.sh index 1503ed8..cc13e0f 100755 --- a/use-standalone-widevine.sh +++ b/use-standalone-widevine.sh @@ -7,7 +7,7 @@ if [ -z "$CHROMIUM_DIR" ]; then fi # Get Widevine archive -/bin/sh ./fetch-latest-widevine.sh -o ./widevine.zip +./fetch-latest-widevine.sh -o ./widevine.zip # Expected directory structure: # widevine.zip # ├── LICENSE.txt