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