From 68ce55b3d9d3924d2236b9ecc05a502262011650 Mon Sep 17 00:00:00 2001 From: Blomblo <63555404+mrblomblo@users.noreply.github.com> Date: Thu, 25 Apr 2024 19:31:12 +0000 Subject: [PATCH] Big changes, see description. -Now updates run.bat -Included instructions on how to disable run.bat updates when running the script --- update.bat | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/update.bat b/update.bat index 1ca166a..0bbfd85 100644 --- a/update.bat +++ b/update.bat @@ -1,5 +1,32 @@ @echo OFF +setlocal + +REM If you don't want run.bat to be automatically updated, please remove the code UNDER "yt-dlp.exe -U", but leave "title Updates done" and the code under it alone. This script should still end with "pause" and "exit". + +REM Update YT-DLP title Updating YT-DLP... + yt-dlp.exe -U + +REM Update run.bat +title Updating run.bat... + +echo . +echo You may notice a large chunk of red text under this text, which you can ignore. I recommend updating run.bat through the actual releases on GitHub, this is just for your convenience. +echo If you don't want run.bat to be automatically updated when you update YT-DLP, please edit this file and follow the instructions there. +echo . + +powershell -executionpolicy Bypass -Command "& { Write-Output (Get-Location).Path.Split('\\')[-2] }" > tmp_folder.txt +if exist tmp_folder.txt ( + set /p folder_name=< tmp_folder.txt + powershell -executionpolicy Bypass -Command "Invoke-WebRequest -Uri https://github.com/mrblomblo/yt-dlp-usage-script/releases/latest/download/run.bat -OutFile ..\%folder_name%\run.bat" + del tmp_folder.txt + echo run.bat has been updated. +) else ( + echo Error: Couldn't determine which folder run.bat is in. +) + +title Updates done + pause -exit \ No newline at end of file +exit