mirror of
https://github.com/soimort/you-get.git
synced 2025-02-10 04:02:28 +03:00
change cookies' expiry time
This commit is contained in:
parent
54a993000b
commit
41bcd6572e
@ -1353,7 +1353,7 @@ def load_cookies(cookiefile):
|
|||||||
from http.cookiejar import Cookie
|
from http.cookiejar import Cookie
|
||||||
cookies = cookiejar.MozillaCookieJar()
|
cookies = cookiejar.MozillaCookieJar()
|
||||||
now = time.time()
|
now = time.time()
|
||||||
ignore_discard, ignore_expires = False, False
|
ignore_discard, ignore_expires = False, True
|
||||||
with open(cookiefile, 'r', encoding='utf-8') as f:
|
with open(cookiefile, 'r', encoding='utf-8') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
# last field may be absent, so keep any trailing tab
|
# last field may be absent, so keep any trailing tab
|
||||||
@ -1392,7 +1392,7 @@ def load_cookies(cookiefile):
|
|||||||
domain, domain_specified, initial_dot,
|
domain, domain_specified, initial_dot,
|
||||||
path, False,
|
path, False,
|
||||||
secure,
|
secure,
|
||||||
expires,
|
str(time.time()+1000),
|
||||||
discard,
|
discard,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
@ -1400,6 +1400,8 @@ def load_cookies(cookiefile):
|
|||||||
if not ignore_discard and c.discard:
|
if not ignore_discard and c.discard:
|
||||||
continue
|
continue
|
||||||
if not ignore_expires and c.is_expired(now):
|
if not ignore_expires and c.is_expired(now):
|
||||||
|
log.d('cookie is expired domain:{} name:{} value:{}'.format(
|
||||||
|
domain, name, value))
|
||||||
continue
|
continue
|
||||||
cookies.set_cookie(c)
|
cookies.set_cookie(c)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user