1
0
mirror of https://github.com/pirate/ArchiveBox.git synced 2025-08-16 03:24:17 +02:00

check if COOKIE_FILE is file

This commit is contained in:
Nick Sweeting
2024-02-28 18:19:44 -08:00
committed by GitHub
parent 68326a60ee
commit fe11e1c2f4

View File

@@ -174,7 +174,7 @@ def download_url(url: str, timeout: int=None) -> str:
timeout = timeout or TIMEOUT
cookie_jar = http.cookiejar.MozillaCookieJar()
if COOKIES_FILE is not None:
if COOKIES_FILE and Path(COOKIES_FILE).is_file():
cookie_jar.load(COOKIES_FILE, ignore_discard=True, ignore_expires=True)
else:
cookie_jar = None