Merge pull request #26 from FishyW/main

wget2 related fixes
This commit is contained in:
Maksim Ivanov
2024-05-31 09:14:06 +03:00
committed by GitHub
2 changed files with 10 additions and 5 deletions

View File

@@ -19,6 +19,11 @@ if ! which wget > /dev/null; then
exit 1 exit 1
fi fi
if ! which jq > /dev/null; then
printf '\033[1mjq\033[0m package must be installed to run this script\n'
exit 1
fi
readonly SCRIPT_PATH=$(dirname $(readlink -f $0)) readonly SCRIPT_PATH=$(dirname $(readlink -f $0))
readonly INSTALL_PATH="/root/.scripts" readonly INSTALL_PATH="/root/.scripts"
readonly USER_NAME="$(logname)" readonly USER_NAME="$(logname)"

View File

@@ -20,7 +20,7 @@ if ! which wget > /dev/null; then
exit 1 exit 1
fi fi
if which pacman > /dev/null; then if which pacman &> /dev/null; then
ARCH_SYSTEM=true ARCH_SYSTEM=true
fi fi
@@ -47,8 +47,8 @@ fi
#Getting download links #Getting download links
printf 'Getting download links...\n' printf 'Getting download links...\n'
##ffmpeg ##ffmpeg
readonly FFMPEG_URL_MAIN=$(wget -q4O - $FFMPEG_SRC_MAIN | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1) readonly FFMPEG_URL_MAIN=$(wget -q4O - $FFMPEG_SRC_MAIN | jq -r '.[0].assets[0].browser_download_url')
readonly FFMPEG_URL_ALT=$(wget -q4O - $FFMPEG_SRC_ALT | grep browser_download_url | cut -d '"' -f 4 | grep linux-x64 | head -n 1) readonly FFMPEG_URL_ALT=$(wget -q4O - $FFMPEG_SRC_ALT | jq -r '.[0].assets[0].browser_download_url')
[[ $(basename $FFMPEG_URL_ALT) < $(basename $FFMPEG_URL_MAIN) ]] && readonly FFMPEG_URL=$FFMPEG_URL_MAIN || readonly FFMPEG_URL=$FFMPEG_URL_ALT [[ $(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 if [[ -z $FFMPEG_URL ]]; then
printf 'Failed to get ffmpeg download URL. Exiting...\n' printf 'Failed to get ffmpeg download URL. Exiting...\n'
@@ -65,14 +65,14 @@ fi
printf 'Downloading files...\n' printf 'Downloading files...\n'
mkdir -p "$TEMP_DIR/opera-fix" mkdir -p "$TEMP_DIR/opera-fix"
##ffmpeg ##ffmpeg
wget -q4 --show-progress $FFMPEG_URL -O "$TEMP_DIR/opera-fix/ffmpeg.zip" wget -q4 --progress=bar:force:noscroll $FFMPEG_URL -O "$TEMP_DIR/opera-fix/ffmpeg.zip"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
printf 'Failed to download ffmpeg. Check your internet connection or try later\n' printf 'Failed to download ffmpeg. Check your internet connection or try later\n'
exit 1 exit 1
fi fi
##Widevine ##Widevine
if $FIX_WIDEVINE; then if $FIX_WIDEVINE; then
wget -q4 --show-progress "$WIDEVINE_URL" -O "$TEMP_DIR/opera-fix/widevine.zip" wget -q4 --progress=bar:force:noscroll "$WIDEVINE_URL" -O "$TEMP_DIR/opera-fix/widevine.zip"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
printf 'Failed to download Widevine CDM. Check your internet connection or try later\n' printf 'Failed to download Widevine CDM. Check your internet connection or try later\n'
exit 1 exit 1