From 0e8804ee47a2bd178aa0b1774c6698e5935ad715 Mon Sep 17 00:00:00 2001 From: Alexandr Reshetnikov Date: Fri, 8 Mar 2024 12:16:42 +0400 Subject: [PATCH] vlc + .gitignore (#48) --- .gitignore | 1 + VLC/.gitignore | 1 + VLC/create_install.bat | 4 ++++ VLC/create_install.sh | 21 +++++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 VLC/.gitignore create mode 100644 VLC/create_install.bat create mode 100755 VLC/create_install.sh diff --git a/.gitignore b/.gitignore index 425b6091..8defcdb8 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ _AutoinstallCreator/AutoinstallCreator* *.old *.md *.log +*.ini .idea/ .empty diff --git a/VLC/.gitignore b/VLC/.gitignore new file mode 100644 index 00000000..8049aa53 --- /dev/null +++ b/VLC/.gitignore @@ -0,0 +1 @@ +vlc-*/ diff --git a/VLC/create_install.bat b/VLC/create_install.bat new file mode 100644 index 00000000..36b50a24 --- /dev/null +++ b/VLC/create_install.bat @@ -0,0 +1,4 @@ +@echo off +"%~dp0..\.tools\busybox.exe" bash "%~dp0create_install.sh" + +exit /b %errorlevel% diff --git a/VLC/create_install.sh b/VLC/create_install.sh new file mode 100755 index 00000000..ee1e33e7 --- /dev/null +++ b/VLC/create_install.sh @@ -0,0 +1,21 @@ +#!/bin/bash +dp0="$(realpath "$(dirname "$0")")" +dp0_tools="$dp0/../.tools" && source "$dp0_tools/env_tools.sh" +set -e +cd "$dp0" + +latest_version=https://www.videolan.org/vlc/download-windows.html +echo Get latest version: "$latest_version" ... +latest_version_str=$($curl --silent --location "$latest_version" | "$grep" --only-matching '(?<=href=")[^\s]+win64/vlc-[^\s]+(?=-win64\.exe")' | "$grep" --only-matching '[^-]+$' | head -n1) +[[ -z "$latest_version_str" ]] && { + echo "Cannot get mirror link" + exit 1 +} + +download_url="https://download.videolan.org/pub/videolan/vlc/$latest_version_str/win64/vlc-$latest_version_str-win64.zip" +filename="$(basename -- "$download_url")" +echo "Downloading: $download_url ..." +$curl --location "$download_url" --remote-name + +echo Extracting ... +"$p7z" x "$filename" "-o." -aoa -r