From cad684e2093a89044db8eeb5b2cf963350776371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?X=C3=A9fir=20Destiny?= Date: Wed, 11 Dec 2019 19:40:35 +0100 Subject: [PATCH] Add get404 cron --- get404.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 get404.py diff --git a/get404.py b/get404.py new file mode 100644 index 0000000..7ac9af9 --- /dev/null +++ b/get404.py @@ -0,0 +1,13 @@ +from config import app +from connectors import Connector +from models import AnimeLink + +app.config['SQLALCHEMY_ECHO'] = False +links = AnimeLink.query.all() + +for link in links: + connect = Connector.get_instance(link.link, link.title.keyword) + html = connect.curl_content(link.link) + + if html['http_code'] is not 200: + print('(%d) %s %s : %s' % (html['http_code'], link.title.name, link.season, link.link))