nadimkobeissi / mkbsd

Download all the wallpapers in MKBHD's "Panels" app
Do What The F*ck You Want To Public License
3.66k stars 448 forks source link

Batch Script Version - No additional software required #49

Open amakvana opened 1 month ago

amakvana commented 1 month ago

Here's a quick and dirty Batch script that will also pull the images from the API. No additional software required, just paste the script into Notepad, save as a ".bat" file and run it.

@echo off 
setlocal enableDelayedExpansion
>nul 2>&1 chcp 65001

cd /d "%~dp0"
>nul 2>&1 mkdir "wallpapers"
set "dest=%~dp0wallpapers"

for /f "tokens=2 delims=, " %%a in ('curl -sL https://storage.googleapis.com/panels-api/data/20240916/media-1a-i-p~s ^| find /i "dhd"') do (
    for /f "tokens=1 delims=?" %%b in ("%%~a") do for %%c in ("%%~b") do set "fn=%%~nxc" 
    echo(Downloading !fn! ...
    >nul 2>&1 curl -sL %%~a -o "%dest%\!RANDOM!!RANDOM!-!fn!"
    >nul 2>&1 ping 192.0.2.0 -n 1 -w 500
)

Wallpapers will be located inside a folder called wallpapers located in the same directory as script execution. PING is used to add a 0.5s delay between each download.

Make sure your filepath does not contain a ! inside it.