From 329b429005c52e5eaba1a62f7d878564f63ec3c6 Mon Sep 17 00:00:00 2001 From: Ld-Hagen <34414986+Ld-Hagen@users.noreply.github.com> Date: Wed, 13 Oct 2021 21:33:28 +0300 Subject: [PATCH] No hardcoded Opera directory in apt hook. Some text messages and readme changes --- README.md | 13 ++++++++----- install.sh | 2 +- scripts/99fix-opera | 4 ++-- scripts/fix-opera.sh | 6 +++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index ef53b11..721dc73 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Fix Opera Linux ffmpeg & WidevineCdm +# Fix Opera Linux libffmpeg & WidevineCdm -* Fix Opera html5 media content including DRM-protected one. -* It script must be execute all times opera will fails on showing html5 media content. -* On Debian-based and Arch-based distros it may be started automatically after Opera update. +* Fixes Opera html5 media content including DRM-protected one. +* This script must be executed all times opera fails on showing html5 media content. +* On Debian-based and Arch-based distributions it could be started automatically after Opera each update or reinstall. ## Requirements @@ -12,9 +12,12 @@ 2. **unzip** (Is needed for unpacking the downloaded file) ```sudo apt install unzip``` +2. **git** (Is needed for fetching this script) + ```sudo apt install git``` + ## Usage -1. Clone this repo and +1. Clone this repo ```git clone https://github.com/Ld-Hagen/fix-opera-linux-ffmpeg-widevine.git``` diff --git a/install.sh b/install.sh index f567009..b4a8e31 100755 --- a/install.sh +++ b/install.sh @@ -51,7 +51,7 @@ create_hook () done } -ptintf 'Installing script to ypur system...\n' +ptintf 'Installing script to your system...\n' printf 'Would you like to apply Widevine CDM fix? [y/n]' while read FIX_WIDEVINE; do diff --git a/scripts/99fix-opera b/scripts/99fix-opera index b2a5350..b39dbb7 100644 --- a/scripts/99fix-opera +++ b/scripts/99fix-opera @@ -1,2 +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";}; +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";}; diff --git a/scripts/fix-opera.sh b/scripts/fix-opera.sh index 5fbf2f1..8cf859a 100755 --- a/scripts/fix-opera.sh +++ b/scripts/fix-opera.sh @@ -92,7 +92,7 @@ if $FIX_WIDEVINE; then fi #Moving libraries to its place -printf 'Moving libraries to its place...\n' +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" @@ -105,6 +105,6 @@ if $FIX_WIDEVINE; then printf "[\n {\n \"preload\": \"$OPERA_WIDEVINE_DIR\"\n }\n]\n" > "$OPERA_WIDEVINE_CONFIG" fi -#Removing temprary files -printf 'Removing temprary files...\n' +#Removing temporary files +printf 'Removing temporary files...\n' rm -rf "$TEMP_DIR/opera-fix"