Created
August 22, 2020 08:46
-
-
Save mertcangokgoz/72c443fa89aaa81c4de5881dde54113a to your computer and use it in GitHub Desktop.
Download Mikroskop Online Catalog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Download Mikroskop Online Catalog | |
# | |
# Visit: | |
# https://migroskop.migros.com.tr/ | |
# | |
# Requirements: | |
# apt install wget jq | |
# | |
# Copyright (c) https://gist.github.com/wvengen/27162f92acadfaf3ac6b782b9a018285 | |
# Via wvengen | |
# | |
# Copyright (c) 2020 | |
# Via Mertcan GÖKGÖZ | |
# | |
# | |
if [ ! "$1" ]; then | |
echo "Usage: $0 <FULL-URL>" | |
exit 1 | |
fi | |
URL="$1" | |
wget -q -O /dev/stdout "$URL" | sed 's/^\s*var\s\+data\s\+=\s\+\(.*\);\s*$/\1/p;d' > "image.json" | |
cat "image.json" | jq -r '.spreads[].pages[].images | .at2400 // .at2000 // .at1600 // .at1200 // .at1000' > "urls.txt" | |
rm image.json | |
i=1 | |
for u in `cat "urls.txt"`; do | |
echo "$u" | |
wget -q "https://migroskop.migros.com.tr$u" | |
i=$(( $i + 1 )) | |
done | |
rm urls.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment