Created
December 1, 2020 05:21
-
-
Save Unihedro/c9ac8ca4e1d6cd60bb19494f7f2875f6 to your computer and use it in GitHub Desktop.
my aoc input downloader.sh
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/bash | |
DAY=$(( $(date -d "$D" '+%d') )) | |
#DAY=9 | |
echo "https://adventofcode.com/2020/day/$DAY/input" | |
while true;do | |
if [[ $(curl "https://adventofcode.com/2020/day/$DAY/input" -H 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'cookie: session=[my session cookie dun hack pls]' --compressed --output input -w "%{response_code}") != 404 ]]; then | |
stat input | |
head input | |
break | |
fi | |
sleep 3 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment