From 638d9edb2646a8fd288977c78fe153be9c27c50f Mon Sep 17 00:00:00 2001 From: TheTechRobo <52163910+TheTechRobo@users.noreply.github.com> Date: Sun, 5 Jun 2022 12:09:17 -0400 Subject: [PATCH] wip --- Makefile | 2 +- pipeline.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bcb0c8d..35cf33a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ run: make clean - docker build -t img . + docker build -t strawpoll-grab . docker run -v "/media/thetechrobo/2tb/spoll:/finished" --rm img TheTechRobo --concurrent 1 clean: diff --git a/pipeline.py b/pipeline.py index 8804110..1b567ab 100644 --- a/pipeline.py +++ b/pipeline.py @@ -61,7 +61,10 @@ class CheckItemExists(SimpleTask): def process(self, item): resp = requests.get(f"https://strawpoll.me/{item['item_name']}") print(f"Got status code {resp.status_code}") - assert resp.status_code == 200, "Poll not found. Save time, archive better." + if resp.status_code != 200: + print("Poll not found. Save time, archive better.") + item.cancel() + raise Exception() class CheckIP(SimpleTask): def __init__(self):