Avoid cookiejar if cache is disabled
Some checks failed
Test Python / Test (push) Has been cancelled
Some checks failed
Test Python / Test (push) Has been cancelled
This commit is contained in:
parent
64772116a3
commit
ea3d27dee6
|
@ -195,12 +195,12 @@ if cfscrape:
|
|||
pass
|
||||
|
||||
|
||||
def get_session(cookiejar, *, with_cfscrape: bool, ignore_cache: bool) -> requests.Session:
|
||||
def get_session(cookiejar: Sequence, *, with_cfscrape: bool, ignore_cache: bool) -> requests.Session:
|
||||
assert isinstance(with_cfscrape, bool)
|
||||
session_class = requests_cache.CachedSession
|
||||
if ignore_cache:
|
||||
session_class = requests.Session
|
||||
logger.warn('HTTP cache disabled')
|
||||
return requests.Session()
|
||||
if cfscrape:
|
||||
session_class = CachedCfScrape
|
||||
session = session_class('output/web_cache', cookies=cookiejar)
|
||||
|
|
Loading…
Reference in New Issue
Block a user