Added test to download from brickinstructions if lego.com is unavailable
This commit is contained in:
parent
8c31492779
commit
affb4bb441
20
lego_dl.sh
20
lego_dl.sh
@ -137,10 +137,28 @@
|
||||
echo "--> Not downloaded. Try again manually..."
|
||||
echo "$filename was not downloaded. Check CURL" >> $logfile
|
||||
fi
|
||||
fi
|
||||
#random sleep in order to not look like a script
|
||||
sleep $(( ( RANDOM % 5 ) + 1 ))
|
||||
else
|
||||
#test
|
||||
biLink="https://lego.brickinstructions.com/pdfdrop/"
|
||||
if validate_url "$biLink$tID.pdf"; then
|
||||
echo -ne "Found on BrickInstructions... Downloading..."
|
||||
curl -H "Mozilla/5.0 (platform; rv:75.0) Gecko/20100101 Firefox/75.0" -L "$biLink$tID.pdf" --silent --output "$downloadFolder/$filename"
|
||||
if [ -f "$downloadFolder/$filename" ]; then
|
||||
echo "Done! > $filename"
|
||||
else
|
||||
echo "ERROR!"
|
||||
if [[ $error_level = 1 || $error_level = 2 ]]; then
|
||||
echo "--> Not downloaded. Try again manually..."
|
||||
echo "$filename was not downloaded. Check CURL" >> $logfile
|
||||
fi
|
||||
fi
|
||||
#random sleep in order to not look like a script
|
||||
sleep $(( ( RANDOM % 5 ) + 1 ))
|
||||
fi
|
||||
|
||||
fi
|
||||
else
|
||||
if [[ $error_level = 1 || $error_level = 2 ]]; then
|
||||
echo "-> $tID is not available. Skipping..."
|
||||
|
Loading…
Reference in New Issue
Block a user