This commit is contained in:
parent
8547976735
commit
5c66457212
@ -6,7 +6,7 @@ app.config['SQLALCHEMY_ECHO'] = False
|
||||
links = AnimeLink.query.all()
|
||||
|
||||
for link in links:
|
||||
html = curl_content(link.link)
|
||||
html = curl_content(link.link, debug=False)
|
||||
|
||||
if html['http_code'] != 200:
|
||||
print('(%d) %s %s : %s' % (html['http_code'], link.title.name, link.season, link.link))
|
||||
|
@ -77,7 +77,7 @@ class Cache:
|
||||
ConnectorCache = Cache()
|
||||
|
||||
|
||||
def curl_content(url, params=None, ajax=False):
|
||||
def curl_content(url, params=None, ajax=False, debug=True):
|
||||
if ajax:
|
||||
headers = {'X-Requested-With': 'XMLHttpRequest'}
|
||||
else:
|
||||
@ -94,6 +94,7 @@ def curl_content(url, params=None, ajax=False):
|
||||
except (RequestException, CloudflareException, CaptchaException) as e:
|
||||
output = ''
|
||||
http_code = 500
|
||||
if debug:
|
||||
getLogger().exception(e)
|
||||
|
||||
return {'http_code': http_code, 'output': output}
|
||||
|
Reference in New Issue
Block a user