mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2026-05-09 05:21:13 +02:00
flaresolverr_proxy watch for super future cookies, reduce proxy timeout.
This commit is contained in:
parent
52e740cf58
commit
e28773850f
1 changed files with 13 additions and 1 deletions
|
|
@ -56,7 +56,7 @@ class FlareSolverr_ProxyFetcher(RequestsFetcher):
|
|||
json={'cmd': cmd,
|
||||
'url':url,
|
||||
#'userAgent': 'Mozilla/5.0',
|
||||
'maxTimeout': 60000,
|
||||
'maxTimeout': 30000,
|
||||
'download': True,
|
||||
# causes response to be base64
|
||||
# encoded which makes images
|
||||
|
|
@ -114,6 +114,18 @@ def cookiejar_to_jsonable(cookiejar):
|
|||
def cookiejson_to_jarable(data):
|
||||
retval = []
|
||||
for c in data:
|
||||
## Ran into a site setting a cookie for year 9999, which
|
||||
## caused datetime.datetime.utcfromtimestamp() to fail.
|
||||
## 30000000000 == 2920-08-30 05:20:00. If 900 years isn't
|
||||
## enough, somebody can fix it then.
|
||||
## (current global_cookie/
|
||||
# logger.debug(c['expires'])
|
||||
if c['expires'] > 30000000000:
|
||||
c['expires'] = 30000000000
|
||||
# logger.debug(c['name'])
|
||||
# import datetime
|
||||
# logger.debug(datetime.datetime.utcfromtimestamp(c['expires']))
|
||||
|
||||
retval.append(Cookie(0, # version
|
||||
c['name'],
|
||||
c['value'],
|
||||
|
|
|
|||
Loading…
Reference in a new issue