mirror of
https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git
synced 2025-12-29 11:33:00 +03:00
Compare commits
18 Commits
nwjs-ffmpe
...
nwjs-ffmpe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
69c2b39fc4 | ||
|
|
03743dbe3d | ||
|
|
f3e2780911 | ||
|
|
c829b43a97 | ||
|
|
157b47fb81 | ||
|
|
749d04e983 | ||
|
|
de681b22c8 | ||
|
|
e4e5108b8c | ||
|
|
009d48f6f2 | ||
|
|
db1616eaeb | ||
| a275e5b442 | |||
|
|
e303fe6f1d | ||
| c7b5adf475 | |||
| 1f469e262c | |||
| ececb7206e | |||
|
|
755b753e9b | ||
|
|
d5f1a745e4 | ||
| 5654313dc9 |
2
99fix-opera
Normal file
2
99fix-opera
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
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";};
|
||||||
59
README.md
59
README.md
@@ -1,24 +1,18 @@
|
|||||||
# Fix Opera Linux ffmpeg
|
# Fix Opera Linux ffmpeg & WidevineCdm
|
||||||
|
|
||||||
* Fix Opera html5 media content.
|
* Fix Opera html5 media content
|
||||||
* It script must be execute all times opera will fails on showing html5 media content.
|
* It script must be execute all times opera will 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.
|
* Now it also fixes WidevineCdm support for DRM video. You can try it on Vevo youtube channel for example.
|
||||||
|
|
||||||
## Index
|
## Requirements
|
||||||
|
|
||||||
* [Requirements](#Requirements)
|
|
||||||
* [How use](#How-use)
|
|
||||||
* [Create an alias](#Create-an-alias)
|
|
||||||
|
|
||||||
### Requirements
|
|
||||||
|
|
||||||
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** (Is needed for unzipping the downloaded file)
|
2. **unzip**, **binutils** (Is needed for unpacking the downloaded file)
|
||||||
```sudo apt install unzip```
|
```sudo apt install unzip binutils```
|
||||||
|
|
||||||
### How use
|
## Usage
|
||||||
|
|
||||||
1. Clone this repo
|
1. Clone this repo
|
||||||
|
|
||||||
@@ -28,40 +22,35 @@
|
|||||||
|
|
||||||
```cd ./fix-opera-linux-ffmpeg-widevine```
|
```cd ./fix-opera-linux-ffmpeg-widevine```
|
||||||
|
|
||||||
3. Give execute permissions to the script file
|
3. (*Optional*) You may disable **Widevine** fix if one that comes with Opera works well for you.
|
||||||
|
|
||||||
```chmod +x ./fix-opera.sh```
|
```sed -i '/FIX_WIDEVINE=/s/true/false/g' ./fix-opera.sh```
|
||||||
|
|
||||||
4. Execute the script using sudo (Is needed for put the ffmpeg lib into the opera instalation folder)
|
4. Run script. And if it works well got ot next step.
|
||||||
|
|
||||||
```sudo ./fix-opera.sh```
|
```sudo ./fix-opera.sh```
|
||||||
|
|
||||||
### Create an alias
|
5. Create a **.scripts** folder on **root**'s **home**
|
||||||
|
|
||||||
1. Clone this repo
|
```sudo mkdir ~root/.scripts```
|
||||||
|
|
||||||
```git clone https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git```
|
6. Copy the script into the **.scripts** folder
|
||||||
|
|
||||||
2. Create a **script** folder on your **home**
|
```sudo cp ./fix-opera.sh ~root/.scripts```
|
||||||
|
|
||||||
```mkdir ~/.scripts```
|
7. Choose one or both options
|
||||||
|
* (*Optional*) Create an **alias**. And then you'll be able to start it by typing ```fix-opera``` command in terminal.
|
||||||
|
|
||||||
3. Copy the script into the **script** folder
|
```echo "alias fix-opera='sudo ~root/.scripts/fix-opera.sh' # Opera fix HTML5 media" >> ~/.bashrc```
|
||||||
|
|
||||||
```cp ./fix-opera-linux-ffmpeg-widevine/fix-opera.sh ~/.scripts```
|
|
||||||
|
|
||||||
4. Give execute permissions to the script file
|
|
||||||
|
|
||||||
```chmod +x ~/.scripts/fix-opera.sh```
|
|
||||||
|
|
||||||
5. Create an **alias** on the **.bashrc** file (Remember replace **<YOUR_USER>** for your linux user)
|
|
||||||
|
|
||||||
```echo "alias fix-opera='sudo /home/<YOUR_USER>/.scripts/fix-opera.sh' # Opera fix HTML5 media" >> ~/.bashrc```
|
|
||||||
|
|
||||||
6. Update **.bashrc** file
|
|
||||||
|
|
||||||
```source ~/.bashrc```
|
```source ~/.bashrc```
|
||||||
|
|
||||||
7. Delete the repo
|
* (*Optional*) Autostart after each opera upgrade (Debian-based distros)
|
||||||
|
|
||||||
```rm -rf ./fix-opera-linux-ffmpeg-widevine```
|
```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```
|
||||||
|
|||||||
76
fix-opera.sh
76
fix-opera.sh
@@ -7,53 +7,87 @@ if [[ $(whoami) != "root" ]]; then
|
|||||||
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$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 CHROME_DL_LINK="https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb"
|
||||||
|
|
||||||
readonly GIT_API=https://api.github.com/repos/Ld-Hagen/fix-opera-linux-ffmpeg-widevine/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
|
||||||
|
|
||||||
printf '\nGetting Url ...\n'
|
if ! which ar > /dev/null && $FIX_WIDEVINE; then
|
||||||
|
printf '\033[1mbinutils\033[0m package must be installed to fix Widevine\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
readonly OPERA_FFMPEG_URL=$(curl -s $GIT_API | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1)
|
if ! which unzip > /dev/null; then
|
||||||
|
printf '\033[1munzip\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
printf '\nDownloading ffmpeg ...\n'
|
if ! which wget > /dev/null; then
|
||||||
|
printf '\033[1mwget\033[0m package must be installed to run this script\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
wget $OPERA_FFMPEG_URL -O "$TEMP_FILE$ZIP_FILE"
|
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)
|
||||||
|
|
||||||
printf "\nUnzipping ...\n\n"
|
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
|
||||||
|
|
||||||
unzip "$TEMP_FILE$ZIP_FILE" -d $TEMP_FILE
|
if [ -z "$OPERA_FFMPEG_URL" ]; then
|
||||||
|
printf 'Failed to get ffmpeg download URL. EXiting...\n'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
printf "\nMoving file on $OPERA_FILE ...\n"
|
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
|
mv -f "$TEMP_FILE/$FILE_NAME" $OPERA_FILE
|
||||||
|
|
||||||
printf '\nDeleting 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"
|
rm -rf "$OPERA_FOLDER/lib_extra/WidevineCdm"
|
||||||
mkdir "$OPERA_FOLDER/lib_extra"
|
printf "Downloading Google Chrome ...\n"
|
||||||
printf "\nDownloading Google Chrome ...\n"
|
mkdir "$TEMP_FOLDER/chrome"
|
||||||
wget -P "$TEMP_FOLDER" "$CHROME_DL_LINK"
|
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 "\nExtracting Chrome to temporary folder ...\n"
|
printf "Extracting Chrome to temporary folder ...\n"
|
||||||
CHROME_PKG_NAME=`basename $CHROME_DL_LINK`
|
CHROME_PKG_NAME=`basename $CHROME_DL_LINK`
|
||||||
dpkg -x "$TEMP_FOLDER/$CHROME_PKG_NAME" "$TEMP_FOLDER/chrome"
|
ar x "$CHROME_PKG_NAME"
|
||||||
|
tar xf data.tar.xz
|
||||||
|
|
||||||
printf "\nInstalling WidevineCdm ...\n"
|
printf "Installing WidevineCdm ...\n"
|
||||||
cp -R "$TEMP_FOLDER/chrome/opt/google/chrome/WidevineCdm" "$OPERA_FOLDER/lib_extra/"
|
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 "[\n {\n \"preload\": \"$OPERA_FOLDER/lib_extra/WidevineCdm\"\n }\n]\n" > "$OPERA_FOLDER/resources/widevine_config.json"
|
||||||
|
|
||||||
printf "\nDeleting temprorary files ...\n"
|
printf "Deleting temprorary files ...\n"
|
||||||
rm -rf "$TEMP_FOLDER/chrome"
|
rm -rf "$TEMP_FOLDER/chrome"
|
||||||
else
|
else
|
||||||
printf "\nInstalling WidevineCdm skipped\n"
|
printf "Installing WidevineCdm skipped\n"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user