From 82e010c7957843aa45b2a89bfbba6e472ce9c655 Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 1 Oct 2019 21:59:32 -0400 Subject: [PATCH] Fix Kheina returning content-type errors --- src/utils/scraper.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utils/scraper.py b/src/utils/scraper.py index 49edfc5..d7817db 100644 --- a/src/utils/scraper.py +++ b/src/utils/scraper.py @@ -48,6 +48,10 @@ async def query_kheina(url): content = re.sub('', '', content) soup = BeautifulSoup(content, 'html5lib') + + if soup.find('data', id='error'): + return False + results = soup.find('data', id='results').string results = ast.literal_eval(results) iqdbdata = soup.find('data', id='iqdbdata').string