Fix crash on Cloudflare exceptions
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
38936026ea
commit
3d456a857a
@ -8,6 +8,7 @@ from urllib.parse import quote
|
|||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
from cloudscraper import create_scraper
|
from cloudscraper import create_scraper
|
||||||
|
from cloudscraper.exceptions import CloudflareException
|
||||||
from dateparser import parse
|
from dateparser import parse
|
||||||
from requests import RequestException
|
from requests import RequestException
|
||||||
|
|
||||||
@ -92,7 +93,7 @@ def curl_content(url, params=None, ajax=False):
|
|||||||
|
|
||||||
output = response.text
|
output = response.text
|
||||||
http_code = response.status_code
|
http_code = response.status_code
|
||||||
except RequestException as e:
|
except (RequestException, CloudflareException) as e:
|
||||||
output = ''
|
output = ''
|
||||||
http_code = 500
|
http_code = 500
|
||||||
if IS_DEBUG:
|
if IS_DEBUG:
|
||||||
|
Reference in New Issue
Block a user