mirror of
https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git
synced 2025-12-29 11:33:00 +03:00
Compare commits
13 Commits
nwjs-ffmpe
...
nwjs-ffmpe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
58be0f5c1c | ||
|
|
52954635c8 | ||
|
|
8c64261203 | ||
|
|
f73a02813b | ||
|
|
78c9762d17 | ||
|
|
c9b8eb396e | ||
|
|
a6d2682300 | ||
|
|
08602bd452 | ||
|
|
7c750ca4ba | ||
|
|
7c5f5ffd5f | ||
|
|
209825c5fd | ||
|
|
e9174eb089 | ||
|
|
c74624cbc1 |
@@ -1,2 +0,0 @@
|
|||||||
DPkg::Pre-Invoke {"stat -c %Z /usr/lib/x86_64-linux-gnu/opera/opera > /tmp/opera.timestamp";};
|
|
||||||
DPkg::Post-Invoke {"if [ `stat -c %Z /usr/lib/x86_64-linux-gnu/opera/opera` -ne `cat /tmp/opera.timestamp` ]; then ~root/.scripts/fix-opera.sh; fi; rm /tmp/opera.timestamp";};
|
|
||||||
64
README.md
64
README.md
@@ -1,56 +1,44 @@
|
|||||||
# Fix Opera Linux ffmpeg & WidevineCdm
|
# Fix Opera Linux libffmpeg & WidevineCdm
|
||||||
|
|
||||||
* Fix Opera html5 media content
|
* Fixes Opera html5 media content including DRM-protected one.
|
||||||
* It script must be execute all times opera will fails on showing html5 media content.
|
* This script must be executed all times opera fails on showing html5 media content.
|
||||||
* Now it also fixes WidevineCdm support for DRM video. You can try it on Vevo youtube channel for example.
|
* On Debian-based, RedHat-based and Arch-based distributions it could be started automatically after Opera each update or reinstall.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
1. **wget** (Is needed for downloading the ffmpeg lib and Chrome)
|
1. **wget** (Is needed for downloading the ffmpeg lib and widevine)
|
||||||
```sudo apt install wget```
|
|
||||||
|
|
||||||
2. **unzip**, **binutils** (Is needed for unpacking the downloaded file)
|
**unzip** (Is needed for unpacking the downloaded file)
|
||||||
```sudo apt install unzip binutils```
|
|
||||||
|
**git** (Is needed for fetching this script)
|
||||||
|
|
||||||
|
For Debian-based systems: `sudo apt install wget unzip git`
|
||||||
|
|
||||||
|
For Arch-based systems: `sudo pacman -S wget unzip git`
|
||||||
|
|
||||||
|
For RedHat-based systems: `sudo dnf install wget unzip git`
|
||||||
|
|
||||||
|
2. (*Optional*) **python3-dnf-plugin-post-transaction-actions** (Is needed for autoupdate in RedHat-based systems)
|
||||||
|
`dnf install python3-dnf-plugin-post-transaction-actions`
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
1. Clone this repo
|
1. Clone this repo
|
||||||
|
|
||||||
```git clone https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git```
|
`git clone https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git`
|
||||||
|
|
||||||
2. Go to the repo root folder
|
2. Go to the repo root folder
|
||||||
|
|
||||||
```cd ./fix-opera-linux-ffmpeg-widevine```
|
`cd ./fix-opera-linux-ffmpeg-widevine`
|
||||||
|
|
||||||
3. (*Optional*) You may disable **Widevine** fix if one that comes with Opera works well for you.
|
3. (*Optional*) Run script. And if it works well go to next step.
|
||||||
|
|
||||||
```sed -i '/FIX_WIDEVINE=/s/true/false/g' ./fix-opera.sh```
|
`sudo ./scripts/fix-opera.sh`
|
||||||
|
|
||||||
4. Run script. And if it works well got ot next step.
|
4. Run install script and answer few questions.
|
||||||
|
|
||||||
```sudo ./fix-opera.sh```
|
|
||||||
|
|
||||||
5. Create a **.scripts** folder on **root**'s **home**
|
`sudo ./install.sh`
|
||||||
|
|
||||||
```sudo mkdir ~root/.scripts```
|
|
||||||
|
|
||||||
6. Copy the script into the **.scripts** folder
|
5. Delete the repo
|
||||||
|
|
||||||
```sudo cp ./fix-opera.sh ~root/.scripts```
|
|
||||||
|
|
||||||
7. Choose one or both options
|
`cd .. && rm -rf ./fix-opera-linux-ffmpeg-widevine`
|
||||||
* (*Optional*) Create an **alias**. And then you'll be able to start it by typing ```fix-opera``` command in terminal.
|
|
||||||
|
|
||||||
```echo "alias fix-opera='sudo ~root/.scripts/fix-opera.sh' # Opera fix HTML5 media" >> ~/.bashrc```
|
|
||||||
|
|
||||||
```source ~/.bashrc```
|
|
||||||
|
|
||||||
* (*Optional*) Autostart after each opera upgrade (Debian-based distros)
|
|
||||||
|
|
||||||
```sudo cp ./99fix-opera ~root/.scripts```
|
|
||||||
|
|
||||||
```sudo ln -s ~root/.scripts/99fix-opera /etc/apt/apt.conf.d/```
|
|
||||||
|
|
||||||
8. Delete the repo
|
|
||||||
|
|
||||||
```cd .. && rm -rf ./fix-opera-linux-ffmpeg-widevine```
|
|
||||||
|
|||||||
93
fix-opera.sh
93
fix-opera.sh
@@ -1,93 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# Run using sudo
|
|
||||||
if [[ $(whoami) != "root" ]]; then
|
|
||||||
printf 'Try to run it with sudo\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
readonly TEMP_FOLDER='/tmp/'
|
|
||||||
readonly OPERA_FOLDER='/usr/lib/x86_64-linux-gnu/opera'
|
|
||||||
readonly FILE_NAME='libffmpeg.so'
|
|
||||||
readonly ZIP_FILE='.zip'
|
|
||||||
readonly TEMP_FILE="$TEMP_FOLDER$FILE_NAME"
|
|
||||||
readonly OPERA_FILE="$OPERA_FOLDER/lib_extra/$FILE_NAME"
|
|
||||||
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_ALT=https://api.github.com/repos/Ld-Hagen/fix-opera-linux-ffmpeg-widevine/releases
|
|
||||||
|
|
||||||
if ! which ar > /dev/null && $FIX_WIDEVINE; then
|
|
||||||
printf '\033[1mbinutils\033[0m package must be installed to fix Widevine\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! which unzip > /dev/null; then
|
|
||||||
printf '\033[1munzip\033[0m package must be installed to run this script\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! which wget > /dev/null; then
|
|
||||||
printf '\033[1mwget\033[0m package must be installed to run this script\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf 'Getting ffmpeg download Url ...\n'
|
|
||||||
readonly OPERA_FFMPEG_URL_MAIN=$(wget -qO - $GIT_API_MAIN | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1)
|
|
||||||
readonly OPERA_FFMPEG_URL_ALT=$(wget -qO - $GIT_API_ALT | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1)
|
|
||||||
|
|
||||||
if [ `basename $OPERA_FFMPEG_URL_ALT` \< `basename $OPERA_FFMPEG_URL_MAIN` ]; then
|
|
||||||
readonly OPERA_FFMPEG_URL=$OPERA_FFMPEG_URL_MAIN
|
|
||||||
else
|
|
||||||
readonly OPERA_FFMPEG_URL=$OPERA_FFMPEG_URL_ALT
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -z "$OPERA_FFMPEG_URL" ]; then
|
|
||||||
printf 'Failed to get ffmpeg download URL. EXiting...\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf 'Downloading ffmpeg ...\n'
|
|
||||||
wget -q --show-progress $OPERA_FFMPEG_URL -O "$TEMP_FILE$ZIP_FILE"
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
printf 'Failed to download ffmpeg. Check your internet connection or try later\n'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf "Unzipping ...\n"
|
|
||||||
unzip "$TEMP_FILE$ZIP_FILE" -d $TEMP_FILE > /dev/null
|
|
||||||
|
|
||||||
printf "Moving file on $OPERA_FILE ...\n"
|
|
||||||
mkdir -p "$OPERA_FOLDER/lib_extra"
|
|
||||||
mv -f "$TEMP_FILE/$FILE_NAME" $OPERA_FILE
|
|
||||||
|
|
||||||
printf 'Deleting Temporary files ...\n'
|
|
||||||
find $TEMP_FOLDER -name "*$FILE_NAME*" -delete
|
|
||||||
|
|
||||||
if $FIX_WIDEVINE
|
|
||||||
then
|
|
||||||
rm -rf "$OPERA_FOLDER/lib_extra/WidevineCdm"
|
|
||||||
printf "Downloading Google Chrome ...\n"
|
|
||||||
mkdir "$TEMP_FOLDER/chrome"
|
|
||||||
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"
|
|
||||||
CHROME_PKG_NAME=`basename $CHROME_DL_LINK`
|
|
||||||
ar x "$CHROME_PKG_NAME"
|
|
||||||
tar xf data.tar.xz
|
|
||||||
|
|
||||||
printf "Installing WidevineCdm ...\n"
|
|
||||||
cp -R "$TEMP_FOLDER/chrome/opt/google/chrome/WidevineCdm" "$OPERA_FOLDER/lib_extra/"
|
|
||||||
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/chrome"
|
|
||||||
else
|
|
||||||
printf "Installing WidevineCdm skipped\n"
|
|
||||||
fi
|
|
||||||
125
install.sh
Executable file
125
install.sh
Executable file
@@ -0,0 +1,125 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [[ $(whoami) != "root" ]]; then
|
||||||
|
printf 'Try to run it with sudo\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(uname -m) != "x86_64" ]]; then
|
||||||
|
printf 'This script is intended for 64-bit systems\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! which unzip > /dev/null; then
|
||||||
|
printf '\033[1munzip\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! which wget > /dev/null; then
|
||||||
|
printf '\033[1mwget\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
readonly SCRIPT_PATH=$(dirname $(readlink -f $0))
|
||||||
|
readonly INSTALL_PATH="/root/.scripts"
|
||||||
|
readonly USER_NAME="$(logname)"
|
||||||
|
readonly USER_HOME=$(sudo -u $USER_NAME sh -c 'echo $HOME')
|
||||||
|
|
||||||
|
create_hook ()
|
||||||
|
{
|
||||||
|
printf 'Choose your Linux distro:\n'
|
||||||
|
printf ' 1. Debian-based (Debian/Ubuntu/Mint/etc.)\n'
|
||||||
|
printf ' 2. Arch-based (Arch/Manjaro/etc.)\n'
|
||||||
|
printf ' 3. RedHat-based (RedHat/Fedora/etc.)\n'
|
||||||
|
printf ' 0. Other\n'
|
||||||
|
while read -p "Your choice: " DISTRIB; do
|
||||||
|
case $DISTRIB in
|
||||||
|
"1" )
|
||||||
|
cp -f $SCRIPT_PATH/scripts/99fix-opera $INSTALL_PATH
|
||||||
|
ln -sf $INSTALL_PATH/99fix-opera /etc/apt/apt.conf.d/
|
||||||
|
printf 'Now the script will run automatically every time apt installs or updates Opera.\n'
|
||||||
|
break;;
|
||||||
|
"2" )
|
||||||
|
cp -f $SCRIPT_PATH/scripts/fix-opera.hook $INSTALL_PATH
|
||||||
|
ln -sf $INSTALL_PATH/fix-opera.hook /usr/share/libalpm/hooks/
|
||||||
|
printf 'Now the script will run automatically every time pacman installs or updates Opera.\n'
|
||||||
|
break;;
|
||||||
|
"3" )
|
||||||
|
dnf install python3-dnf-plugin-post-transaction-actions -y
|
||||||
|
cp -f $SCRIPT_PATH/scripts/fix-opera.action $INSTALL_PATH
|
||||||
|
ln -sf $INSTALL_PATH/fix-opera.action /etc/dnf/plugins/post-transaction-actions.d/
|
||||||
|
printf 'Now the script will run automatically every time dnf installs or updates Opera.\n'
|
||||||
|
break;;
|
||||||
|
"0" )
|
||||||
|
printf "Autostart for your Linux distro is currently unsupported\n"
|
||||||
|
break;;
|
||||||
|
* )
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
printf 'Installing script to your system...\n'
|
||||||
|
|
||||||
|
printf 'Would you like to apply Widevine CDM fix? [y/n]'
|
||||||
|
while read FIX_WIDEVINE; do
|
||||||
|
case $FIX_WIDEVINE in
|
||||||
|
"y" | "Y")
|
||||||
|
printf 'Setting FIX_WIDEVINE to true...\n'
|
||||||
|
sed -i '/FIX_WIDEVINE=/s/false/true/g' $SCRIPT_PATH/scripts/fix-opera.sh
|
||||||
|
break;;
|
||||||
|
"n" | "N")
|
||||||
|
printf 'Setting FIX_WIDEVINE to false...\n'
|
||||||
|
sed -i '/FIX_WIDEVINE=/s/true/false/g' $SCRIPT_PATH/scripts/fix-opera.sh
|
||||||
|
break;;
|
||||||
|
* )
|
||||||
|
printf 'Would you like to apply Widevine CDM fix? [y/n]'
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
mkdir -p $INSTALL_PATH
|
||||||
|
cp -f $SCRIPT_PATH/scripts/fix-opera.sh $INSTALL_PATH
|
||||||
|
chmod +x $INSTALL_PATH/fix-opera.sh
|
||||||
|
|
||||||
|
printf "Would you like to create an alias for user $USER_NAME? [y/n]"
|
||||||
|
while read CREATE_ALIAS; do
|
||||||
|
case $CREATE_ALIAS in
|
||||||
|
"y" | "Y")
|
||||||
|
echo "alias fix-opera='sudo ~root/.scripts/fix-opera.sh' # Opera fix HTML5 media" >> $USER_HOME/.bashrc
|
||||||
|
printf "Alias \"fix-opera\" will be available after your next logon.\n"
|
||||||
|
break;;
|
||||||
|
"n" | "N")
|
||||||
|
break;;
|
||||||
|
* )
|
||||||
|
printf "Would you like to create an alias for user $USER_NAME? [y/n]"
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "Would you like to run it automatically after each Opera update? [y/n]"
|
||||||
|
while read CREATE_HOOK; do
|
||||||
|
case $CREATE_HOOK in
|
||||||
|
"y" | "Y")
|
||||||
|
create_hook
|
||||||
|
break;;
|
||||||
|
"n" | "N")
|
||||||
|
break;;
|
||||||
|
* )
|
||||||
|
printf "Would you like to create an alias for user $USER_NAME? [y/n]"
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
printf "Would you like to run it now? [y/n]"
|
||||||
|
while read RUN_NOW; do
|
||||||
|
case $RUN_NOW in
|
||||||
|
"y" | "Y")
|
||||||
|
$INSTALL_PATH/fix-opera.sh
|
||||||
|
break;;
|
||||||
|
"n" | "N")
|
||||||
|
break;;
|
||||||
|
* )
|
||||||
|
printf "Would you like to run it now? [y/n]"
|
||||||
|
continue;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
2
scripts/99fix-opera
Normal file
2
scripts/99fix-opera
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
DPkg::Pre-Invoke {"stat -c %Z $(readlink -f $(which opera)) > /tmp/opera.timestamp";};
|
||||||
|
DPkg::Post-Invoke {"if [ `stat -c %Z $(readlink -f $(which opera))` -ne `cat /tmp/opera.timestamp` ]; then /root/.scripts/fix-opera.sh; fi; rm /tmp/opera.timestamp";};
|
||||||
1
scripts/fix-opera.action
Normal file
1
scripts/fix-opera.action
Normal file
@@ -0,0 +1 @@
|
|||||||
|
opera-stable:in:/root/.scripts/fix-opera.sh
|
||||||
15
scripts/fix-opera.hook
Normal file
15
scripts/fix-opera.hook
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Fix video playback on Opera Upgrade/Install.
|
||||||
|
|
||||||
|
[Trigger]
|
||||||
|
Operation = Install
|
||||||
|
Operation = Upgrade
|
||||||
|
Type = Package
|
||||||
|
Target = opera
|
||||||
|
|
||||||
|
[Action]
|
||||||
|
Description = Fix video playback in Opera browser
|
||||||
|
When = PostTransaction
|
||||||
|
Depends = bash
|
||||||
|
Depends = wget
|
||||||
|
Depends = unzip
|
||||||
|
Exec = /root/.scripts/fix-opera.sh
|
||||||
110
scripts/fix-opera.sh
Executable file
110
scripts/fix-opera.sh
Executable file
@@ -0,0 +1,110 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [[ $(whoami) != "root" ]]; then
|
||||||
|
printf 'Try to run it with sudo\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $(uname -m) != "x86_64" ]]; then
|
||||||
|
printf 'This script is intended for 64-bit systems\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! which unzip > /dev/null; then
|
||||||
|
printf '\033[1munzip\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! which wget > /dev/null; then
|
||||||
|
printf '\033[1mwget\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Config section
|
||||||
|
readonly FIX_WIDEVINE=true
|
||||||
|
readonly TEMP_DIR='/tmp'
|
||||||
|
readonly FFMPEG_SRC_MAIN='https://api.github.com/repos/iteufel/nwjs-ffmpeg-prebuilt/releases'
|
||||||
|
readonly FFMPEG_SRC_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'
|
||||||
|
readonly FFMPEG_SO_NAME='libffmpeg.so'
|
||||||
|
readonly WIDEVINE_SO_NAME='libwidevinecdm.so'
|
||||||
|
readonly WIDEVINE_MANIFEST_NAME='manifest.json'
|
||||||
|
|
||||||
|
readonly OPERA_DIR=$(dirname $(readlink -f $(which opera)))
|
||||||
|
readonly OPERA_LIB_DIR="$OPERA_DIR/lib_extra"
|
||||||
|
readonly OPERA_WIDEVINE_DIR="$OPERA_LIB_DIR/WidevineCdm"
|
||||||
|
readonly OPERA_WIDEVINE_SO_DIR="$OPERA_WIDEVINE_DIR/_platform_specific/linux_x64"
|
||||||
|
readonly OPERA_WIDEVINE_CONFIG="$OPERA_DIR/resources/widevine_config.json"
|
||||||
|
|
||||||
|
#Getting download links
|
||||||
|
printf 'Getting download links...\n'
|
||||||
|
##ffmpeg
|
||||||
|
readonly FFMPEG_URL_MAIN=$(wget -qO - $FFMPEG_SRC_MAIN | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1)
|
||||||
|
readonly FFMPEG_URL_ALT=$(wget -qO - $FFMPEG_SRC_ALT | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1)
|
||||||
|
[[ $(basename $FFMPEG_URL_ALT) < $(basename $FFMPEG_URL_MAIN) ]] && readonly FFMPEG_URL=$FFMPEG_URL_MAIN || readonly FFMPEG_URL=$FFMPEG_URL_ALT
|
||||||
|
if [[ -z $FFMPEG_URL ]]; then
|
||||||
|
printf 'Failed to get ffmpeg download URL. Exiting...\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
##Widevine
|
||||||
|
if $FIX_WIDEVINE; then
|
||||||
|
readonly WIDEVINE_LATEST=`wget -qO - $WIDEVINE_VERSIONS | tail -n1`
|
||||||
|
readonly WIDEVINE_URL="https://dl.google.com/widevine-cdm/$WIDEVINE_LATEST-linux-x64.zip"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Downloading files
|
||||||
|
printf 'Downloading files...\n'
|
||||||
|
mkdir -p "$TEMP_DIR/opera-fix"
|
||||||
|
##ffmpeg
|
||||||
|
wget -q --show-progress $FFMPEG_URL -O "$TEMP_DIR/opera-fix/ffmpeg.zip"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
printf 'Failed to download ffmpeg. Check your internet connection or try later\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
##Widevine
|
||||||
|
if $FIX_WIDEVINE; then
|
||||||
|
wget -q --show-progress "$WIDEVINE_URL" -O "$TEMP_DIR/opera-fix/widevine.zip"
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
printf 'Failed to download Widevine CDM. Check your internet connection or try later\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Extracting files
|
||||||
|
printf 'Extracting files...\n'
|
||||||
|
##ffmpeg
|
||||||
|
unzip -o "$TEMP_DIR/opera-fix/ffmpeg.zip" -d $TEMP_DIR/opera-fix > /dev/null
|
||||||
|
##Widevine
|
||||||
|
if $FIX_WIDEVINE; then
|
||||||
|
unzip -o "$TEMP_DIR/opera-fix/widevine.zip" -d $TEMP_DIR/opera-fix > /dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Removing old libraries and preparing directories
|
||||||
|
printf 'Removing old libraries & making directories...\n'
|
||||||
|
##ffmpeg
|
||||||
|
rm -f "$OPERA_LIB_DIR/$FFMPEG_SO_NAME"
|
||||||
|
mkdir -p "$OPERA_LIB_DIR"
|
||||||
|
##Widevine
|
||||||
|
if $FIX_WIDEVINE; then
|
||||||
|
rm -rf "$OPERA_WIDEVINE_DIR"
|
||||||
|
mkdir -p "$OPERA_WIDEVINE_SO_DIR"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Moving libraries to its place
|
||||||
|
printf 'Moving libraries to their places...\n'
|
||||||
|
##ffmpeg
|
||||||
|
mv -f "$TEMP_DIR/opera-fix/$FFMPEG_SO_NAME" "$OPERA_LIB_DIR"
|
||||||
|
chmod 0644 "$OPERA_LIB_DIR/$FFMPEG_SO_NAME"
|
||||||
|
##Widevine
|
||||||
|
if $FIX_WIDEVINE; then
|
||||||
|
mv -f "$TEMP_DIR/opera-fix/$WIDEVINE_SO_NAME" "$OPERA_WIDEVINE_SO_DIR"
|
||||||
|
chmod 0644 "$OPERA_WIDEVINE_SO_DIR/$WIDEVINE_SO_NAME"
|
||||||
|
mv -f "$TEMP_DIR/opera-fix/$WIDEVINE_MANIFEST_NAME" "$OPERA_WIDEVINE_DIR"
|
||||||
|
chmod 0644 "$OPERA_WIDEVINE_DIR/$WIDEVINE_MANIFEST_NAME"
|
||||||
|
printf "[\n {\n \"preload\": \"$OPERA_WIDEVINE_DIR\"\n }\n]\n" > "$OPERA_WIDEVINE_CONFIG"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Removing temporary files
|
||||||
|
printf 'Removing temporary files...\n'
|
||||||
|
rm -rf "$TEMP_DIR/opera-fix"
|
||||||
Reference in New Issue
Block a user