master
E. Almqvist 4 years ago
parent 4336a56e1f
commit 5ab9dcf6a1
  1. 6
      2020/2.py
  2. 7
      2020/aoc/_api.py
  3. 1000
      2020/input.2
  4. 0
      2020/input.2.2

@ -1,11 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
from aoc import get_input from aoc import get_input
#data = get_input(2).splitlines() inp = get_input(2).splitlines()
#print(data)
inp = open("input.2", "r")
inp = inp.read().splitlines()
def getOper(inp): def getOper(inp):
ops = [] ops = []

@ -47,12 +47,9 @@ def get_input(day: int, year: int = YEAR, overwrite: bool = False):
if overwrite: if overwrite:
data = None data = None
if not data: if not data:
response = requests.get( url = f"https://adventofcode.com/{year}/day/{day}/input".replace("\n", "")
f"https://adventofcode.com/{year}/day/{day}/input", response = requests.get(url, cookies={"session": SESSION})
cookies={"session": SESSION})
if not response.ok: if not response.ok:
if response.status_code == 404:
raise FileNotFoundError(response.text)
raise RuntimeError(f"Request failed, code: {response.status_code}, message: {response.content}") raise RuntimeError(f"Request failed, code: {response.status_code}, message: {response.content}")
data = _set_read_file( data = _set_read_file(
file_name, file_name,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save