Skip to content

Instantly share code, notes, and snippets.

@alexolinux
Created November 24, 2024 01:19
Show Gist options
  • Save alexolinux/0a97e338410fe975ad4ddfccd77f0e67 to your computer and use it in GitHub Desktop.
Save alexolinux/0a97e338410fe975ad4ddfccd77f0e67 to your computer and use it in GitHub Desktop.
This script fix Opera Browser video not supported
#!/bin/bash
FFMPEG_URL="https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download"
FFMPEG_VER="0.93.0"
ARCH="x64"
OPERA_LIB="/usr/lib/x86_64-linux-gnu/opera/lib_extra"
TMP_DIR="/tmp/operalib"
if [ -f "${OPERA_LIB}/libffmpeg.so" ]; then
echo "libffmpeg.so already exists in ${OPERA_LIB}. Exiting."
exit 0
fi
if [ ! -d "${OPERA_LIB}" ]; then
echo "Creating Opera extra library directory..."
sudo mkdir -p "${OPERA_LIB}"
else
echo "Opera extra library directory already exists."
fi
mkdir -p "${TMP_DIR}"
echo "Downloading ffmpeg..."
cd "${TMP_DIR}" || exit 1
wget "${FFMPEG_URL}/${FFMPEG_VER}/${FFMPEG_VER}-linux-${ARCH}.zip" -O "${FFMPEG_VER}-linux-${ARCH}.zip"
echo "Extracting zipped ffmpeg library file..."
if unzip "${FFMPEG_VER}-linux-${ARCH}.zip"; then
echo "Successfully extracted ffmpeg. Installing Opera extra library..."
sudo cp "ffmpeg-v${FFMPEG_VER}-linux-${ARCH}/libffmpeg.so" "${OPERA_LIB}"
else
echo "Failed to extract ffmpeg."
exit 1
fi
echo "Cleaning up..."
rm -rf "${TMP_DIR}"
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment