•  » Extensions
  •  » Thumbnail Generation Script, Piwigo 16 edition

#16 2025-12-02 23:51:50

moberley
Member
2025-11-10
75

Re: Thumbnail Generation Script, Piwigo 16 edition

Sorry I had missed the details of that change on the changelog.

Online

 

#17 2025-12-03 00:48:32

GJSchaller
Member
2022-05-26
33

Re: Thumbnail Generation Script, Piwigo 16 edition

Working Script:

Code:

# Make a login in Piwigo named "cron" (or simialr) with Admin permissions and set a strong password, set up MFA, and generate an API.
#
# change the text REDACTED to the API User and Key
#
# Nightly CRON job (run as www): 1 0 * * * /path/to/your/script/piwigo-thumb-generate.sh

set -e

cd /path/to/your/script/

wget -nv --header='X-PIWIGO-API: REDACTED:REDACTED' -O missing.json "http://(Your Site's URL)/ws.php?format=json&method=pwg.getMissingDerivatives"

while [ `wc -c missing.json | awk '{print $1}'` -gt 50 ]
do
  sed -e 's/[\\\"]//g' \
  -e 's/{stat:ok,result:{next_page:[0-9]*,urls:\[//' \
  -e 's/{stat:ok,result:{urls:\[//' \
  -e 's/\]}}/\n/' \
  -e 's/,/\n/g' \
  -e 's/\&b=[0-9]*//g' missing.json | \
  while read line ; do
    wget -nv -O /dev/null $line
  done
  wget -nv --header='X-PIWIGO-API: REDACTED:REDACTED' -O missing.json "http://(Your Site's URL)/ws.php?format=json&method=pwg.getMissingDerivatives"
done

rm missing.json

Offline

 
  •  » Extensions
  •  » Thumbnail Generation Script, Piwigo 16 edition

Board footer

Powered by FluxBB

github linkedin newsletter Piwigo.org © 2002-2025 · Contact