auto input-download and answer-submit

This commit is contained in:
Stefan Harmuth 2021-12-28 12:51:26 +01:00
parent 149da572c2
commit 082c61beca

View File

@ -84,10 +84,10 @@ class AOCDay:
"https://adventofcode.com/%d/day/%d/input" % (self.year, self.day),
cookies={'session': session_id}
)
print(response)
print(response.content)
if response.status_code != 200:
print("FAIL")
if not response.ok:
print("FAILED to download input: (%s) %s" % (response.status_code, response.text))
return
with open(filename, "wb") as f:
f.write(response.content)
f.flush()