forked from cobra/rural-dict
Don't explode upon 404
Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
3f99b3b6c2
commit
e881c24f70
3
main.py
3
main.py
|
@ -13,7 +13,6 @@ def scrape(url, arg=None):
|
|||
else:
|
||||
data = requests.get(f"{url}{arg}")
|
||||
|
||||
if data.status_code == 200:
|
||||
our_path = re.sub(r".*://.*/", "/", request.url)
|
||||
path = re.sub(r".*://.*/", "/", data.url)
|
||||
print(our_path, path)
|
||||
|
@ -34,8 +33,6 @@ def scrape(url, arg=None):
|
|||
if pages == None:
|
||||
pages = ""
|
||||
return (ret, pages)
|
||||
else:
|
||||
return f"Couldn't get data from Urban Dictionary\n{data.status_code}"
|
||||
|
||||
def render(data):
|
||||
return render_template('index.html', data=data)
|
||||
|
|
Loading…
Reference in New Issue