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 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:
|
||||
|
Reference in New Issue
Block a user