Fix crash on Cloudflare exceptions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Michel Roux 2020-04-17 16:05:51 +02:00
parent 38936026ea
commit 3d456a857a

View File

@ -8,6 +8,7 @@ from urllib.parse import quote
from bs4 import BeautifulSoup
from cloudscraper import create_scraper
from cloudscraper.exceptions import CloudflareException
from dateparser import parse
from requests import RequestException
@ -92,7 +93,7 @@ def curl_content(url, params=None, ajax=False):
output = response.text
http_code = response.status_code
except RequestException as e:
except (RequestException, CloudflareException) as e:
output = ''
http_code = 500
if IS_DEBUG: