Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch Script Version - No additional software required #49

Open
amakvana opened this issue Sep 26, 2024 · 0 comments
Open

Batch Script Version - No additional software required #49

amakvana opened this issue Sep 26, 2024 · 0 comments

Comments

@amakvana
Copy link

amakvana commented Sep 26, 2024

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.

@amakvana amakvana changed the title Batch Script Version Batch Script Version - No additional software required Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant