Skip to content

Instantly share code, notes, and snippets.

@rickt
Created January 20, 2022 21:09
Show Gist options
  • Save rickt/a2ce4736f5f1eeaf62f881f677c2f338 to your computer and use it in GitHub Desktop.
Save rickt/a2ce4736f5f1eeaf62f881f677c2f338 to your computer and use it in GitHub Desktop.
souf bay cam downloader bash script/hack
#! /bin/bash
# set required date range using epoch. sample data used below
RANGE=`seq 1642701000 50 1642710633`
# ensure tmp folder exists
TEMPDIR=/tmp/fogpics_$$
[ ! -d "$TEMPDIR" ] && mkdir -p $TEMPDIR
# download the pics
for TS in $RANGE
do
curl -s 'https://s3-us-west-2.amazonaws.com/alertwildfire-data-public/Axis-GrizzlyPeakLookout1/latest_thumb.jpg?x-request-time=$TS' \
-H 'Connection: keep-alive' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="97", "Chromium";v="97"' \
-H 'DNT: 1' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36' \
-H 'sec-ch-ua-platform: "Linux"' \
-H 'Accept: image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8' \
-H 'Sec-Fetch-Site: cross-site' \
-H 'Sec-Fetch-Mode: no-cors' \
-H 'Sec-Fetch-Dest: image' \
-H 'Referer: https://www.alertwildfire.org/' \
-H 'Accept-Language: en-US,en;q=0.9,en-GB;q=0.8' \
--compressed \
--output $TEMPDIR/$TS.jpg
echo " downloaded $TEMPDIR/$TS.jpg"
done
# make the movie
cd $TEMPDIR
ffmpeg -pattern_type glob -i '*.jpg' -loglevel warning -c:v libx264 -r 3 -pix_fmt yuv420p -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" $TEMPDIR/foggymovie.mp4
cd -
echo " finished $TEMPDIR/foggymovie.mp4"
@burritojustice
Copy link

thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment