From 5bf9ca25c12ee054c0df06365d4910baa3b09c40 Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Wed, 19 Feb 2025 00:27:13 +0400 Subject: [PATCH 1/3] yt-dlp + ffmpeg --- {youtube-dl => yt-dlp}/_create_install.bat | 0 yt-dlp/create_install.sh | 34 ++++++++++++++++++++++ 2 files changed, 34 insertions(+) rename {youtube-dl => yt-dlp}/_create_install.bat (100%) create mode 100644 yt-dlp/create_install.sh diff --git a/youtube-dl/_create_install.bat b/yt-dlp/_create_install.bat similarity index 100% rename from youtube-dl/_create_install.bat rename to yt-dlp/_create_install.bat diff --git a/yt-dlp/create_install.sh b/yt-dlp/create_install.sh new file mode 100644 index 00000000..8c9e63d6 --- /dev/null +++ b/yt-dlp/create_install.sh @@ -0,0 +1,34 @@ +#!/bin/bash +dp0="$(realpath "$(dirname "$0")")" +dp0_tools="$dp0/../.tools" && source "$dp0_tools/env_tools.sh" +set -e +cd "$dp0" + +latest_version=https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest +echo Get latest version: "$latest_version" ... +download_url=$($curl --silent --location "$latest_version" | "$grep" --only-matching '(?<="browser_download_url":\s")[^,]+yt-dlp\.exe(?=")' | head -n1) +[[ -z "$download_url" ]] && { + echo "Cannot get release version" + exit 1 +} + +echo "Downloading: $download_url ..." +$curl --location "$download_url" --remote-name + + + +ffmpeg_latest_version=https://api.github.com/repos/BtbN/FFmpeg-Builds/releases/latest +echo Get latest version: "$ffmpeg_latest_version" ... +ffmpeg_download_url=$($curl --silent --location "$ffmpeg_latest_version" | "$grep" --only-matching '(?<="browser_download_url":\s")[^,]+ffmpeg-master-latest-win64-gpl\.zip(?=")' | head -n1) +[[ -z "$ffmpeg_download_url" ]] && { + echo "Cannot get release version" + exit 1 +} + +ffmpeg_filename="$(basename -- "$ffmpeg_download_url")" + +echo "Downloading: $ffmpeg_download_url ..." +$curl --location "$ffmpeg_download_url" --remote-name + +echo Extracting ... +"$p7z" e "$filename" "-o." *.exe -aoa -r From 5edc3c1cba9a10fb6de898599cc7b5bc213315fd Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Wed, 19 Feb 2025 00:29:23 +0400 Subject: [PATCH 2/3] yt-dlp extract here --- yt-dlp/_create_install.bat | 23 ----------------------- yt-dlp/create_install.bat | 4 ++++ yt-dlp/create_install.sh | 2 +- 3 files changed, 5 insertions(+), 24 deletions(-) delete mode 100644 yt-dlp/_create_install.bat create mode 100644 yt-dlp/create_install.bat diff --git a/yt-dlp/_create_install.bat b/yt-dlp/_create_install.bat deleted file mode 100644 index 2d6ce8ab..00000000 --- a/yt-dlp/_create_install.bat +++ /dev/null @@ -1,23 +0,0 @@ -@pushd "%~dp0" -@call "%~dp0..\.tools\env_tools.bat" - -set latest_version=https://api.github.com/repos/ytdl-org/youtube-dl/releases/latest -echo Get latest version: %latest_version% ... ->raw_download_str.tmp ( - %curl% %latest_version% | %grep% """browser_download_url""" | %grep% --only-matching "[^"" ]*\.exe" | %head% -n1 -) -if %errorlevel% neq 0 ( - echo Cannot get latest version - exit /b %errorlevel% -) - -set /p download_url= < raw_download_str.tmp -echo Downloading: %download_url% ... -%curl% --remote-name --location %download_url% -if %errorlevel% neq 0 ( - echo Cannot download latest version - exit /b %errorlevel% -) - -echo Done. -exit /b %errorlevel% diff --git a/yt-dlp/create_install.bat b/yt-dlp/create_install.bat new file mode 100644 index 00000000..36b50a24 --- /dev/null +++ b/yt-dlp/create_install.bat @@ -0,0 +1,4 @@ +@echo off +"%~dp0..\.tools\busybox.exe" bash "%~dp0create_install.sh" + +exit /b %errorlevel% diff --git a/yt-dlp/create_install.sh b/yt-dlp/create_install.sh index 8c9e63d6..33e9c1cc 100644 --- a/yt-dlp/create_install.sh +++ b/yt-dlp/create_install.sh @@ -31,4 +31,4 @@ echo "Downloading: $ffmpeg_download_url ..." $curl --location "$ffmpeg_download_url" --remote-name echo Extracting ... -"$p7z" e "$filename" "-o." *.exe -aoa -r +"$p7z" e "$ffmpeg_filename" "-o." "*.exe" -aoa -r From a8f14b0cdc1fc676c1dabc08a8f777713f47e64e Mon Sep 17 00:00:00 2001 From: Reshetnikov Alexandr Date: Wed, 19 Feb 2025 00:34:14 +0400 Subject: [PATCH 3/3] +x --- .gitignore | 3 +++ yt-dlp/create_install.sh | 0 2 files changed, 3 insertions(+) mode change 100644 => 100755 yt-dlp/create_install.sh diff --git a/.gitignore b/.gitignore index 8defcdb8..f4b1746c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,9 @@ _AutoinstallCreator/AutoinstallCreator* *.log *.ini +*.part +*.ytdl + .idea/ .empty uTorrent/*.lng diff --git a/yt-dlp/create_install.sh b/yt-dlp/create_install.sh old mode 100644 new mode 100755