Widevine download source changed. No binutils dependency.

This commit is contained in:
Ld-Hagen
2021-09-24 22:22:03 +03:00
parent 69c2b39fc4
commit c74624cbc1
2 changed files with 29 additions and 27 deletions

View File

@@ -9,8 +9,8 @@
1. **wget** (Is needed for downloading the ffmpeg lib and Chrome) 1. **wget** (Is needed for downloading the ffmpeg lib and Chrome)
```sudo apt install wget``` ```sudo apt install wget```
2. **unzip**, **binutils** (Is needed for unpacking the downloaded file) 2. **unzip** (Is needed for unpacking the downloaded file)
```sudo apt install unzip binutils``` ```sudo apt install unzip```
## Usage ## Usage

View File

@@ -6,18 +6,19 @@ if [[ $(whoami) != "root" ]]; then
exit 1 exit 1
fi fi
readonly TEMP_FOLDER='/tmp/' readonly TEMP_FOLDER='/tmp'
readonly OPERA_FOLDER='/usr/lib/x86_64-linux-gnu/opera' readonly OPERA_FOLDER='/usr/lib/x86_64-linux-gnu/opera'
readonly FILE_NAME='libffmpeg.so' readonly FILE_NAME='libffmpeg.so'
readonly ZIP_FILE='.zip' readonly ZIP_FILE='.zip'
readonly TEMP_FILE="$TEMP_FOLDER$FILE_NAME" readonly TEMP_FILE="$TEMP_FOLDER/$FILE_NAME"
readonly OPERA_FILE="$OPERA_FOLDER/lib_extra/$FILE_NAME" readonly OPERA_FILE="$OPERA_FOLDER/lib_extra/$FILE_NAME"
readonly FIX_WIDEVINE=true readonly FIX_WIDEVINE=true
readonly CHROME_DL_LINK="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
readonly GIT_API_MAIN=https://api.github.com/repos/iteufel/nwjs-ffmpeg-prebuilt/releases readonly GIT_API_MAIN=https://api.github.com/repos/iteufel/nwjs-ffmpeg-prebuilt/releases
readonly GIT_API_ALT=https://api.github.com/repos/Ld-Hagen/fix-opera-linux-ffmpeg-widevine/releases readonly GIT_API_ALT=https://api.github.com/repos/Ld-Hagen/fix-opera-linux-ffmpeg-widevine/releases
readonly WIDEVINE_VERSIONS=https://dl.google.com/widevine-cdm/versions.txt
if ! which ar > /dev/null && $FIX_WIDEVINE; then if ! which ar > /dev/null && $FIX_WIDEVINE; then
printf '\033[1mbinutils\033[0m package must be installed to fix Widevine\n' printf '\033[1mbinutils\033[0m package must be installed to fix Widevine\n'
exit 1 exit 1
@@ -65,29 +66,30 @@ mv -f "$TEMP_FILE/$FILE_NAME" $OPERA_FILE
printf 'Deleting Temporary files ...\n' printf 'Deleting Temporary files ...\n'
find $TEMP_FOLDER -name "*$FILE_NAME*" -delete find $TEMP_FOLDER -name "*$FILE_NAME*" -delete
if $FIX_WIDEVINE if $FIX_WIDEVINE; then
then rm -rf "$OPERA_FOLDER/lib_extra/WidevineCdm"
rm -rf "$OPERA_FOLDER/lib_extra/WidevineCdm" printf "Getting Widevine CDM download Url ...\n"
printf "Downloading Google Chrome ...\n" readonly WIDEVINE_LATEST=`wget -qO - $WIDEVINE_VERSIONS | tail -n1`
mkdir "$TEMP_FOLDER/chrome" readonly WIDEVINE_URL="https://dl.google.com/widevine-cdm/$WIDEVINE_LATEST-linux-x64.zip"
cd "$TEMP_FOLDER/chrome"
wget -q --show-progress "$CHROME_DL_LINK"
if [ $? -ne 0 ]; then
printf 'Failed to download Google Chrome. Check your internet connection or try later\n'
exit 1
fi
printf "Extracting Chrome to temporary folder ...\n" printf "Downloading Widevine CDM ...\n"
CHROME_PKG_NAME=`basename $CHROME_DL_LINK` wget -q --show-progress "$WIDEVINE_URL" -O "$TEMP_FOLDER/widevine.zip"
ar x "$CHROME_PKG_NAME" if [ $? -ne 0 ]; then
tar xf data.tar.xz printf 'Failed to download Widevine CDM. Check your internet connection or try later\n'
exit 1
fi
printf "Installing WidevineCdm ...\n" printf "Extracting Widevine CDM to temporary folder ...\n"
cp -R "$TEMP_FOLDER/chrome/opt/google/chrome/WidevineCdm" "$OPERA_FOLDER/lib_extra/" unzip "$TEMP_FOLDER/widevine.zip" -d $TEMP_FOLDER/widevine > /dev/null
printf "[\n {\n \"preload\": \"$OPERA_FOLDER/lib_extra/WidevineCdm\"\n }\n]\n" > "$OPERA_FOLDER/resources/widevine_config.json"
printf "Deleting temprorary files ...\n" printf "Installing WidevineCdm ...\n"
rm -rf "$TEMP_FOLDER/chrome" mkdir -p "$OPERA_FOLDER/lib_extra/WidevineCdm/_platform_specific/linux_x64"
else cp -R "$TEMP_FOLDER/widevine/manifest.json" "$OPERA_FOLDER/lib_extra/WidevineCdm/manifest.json"
printf "Installing WidevineCdm skipped\n" cp -R "$TEMP_FOLDER/widevine/libwidevinecdm.so" "$OPERA_FOLDER/lib_extra/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so"
printf "[\n {\n \"preload\": \"$OPERA_FOLDER/lib_extra/WidevineCdm\"\n }\n]\n" > "$OPERA_FOLDER/resources/widevine_config.json"
printf "Deleting temprorary files ...\n"
rm -rf "$TEMP_FOLDER/widevine"
else
printf "Installing WidevineCdm skipped\n"
fi fi