fix cookie checks for patreon, fanbox, fantia

The changes in 9a255344 caused a warning about missing cookies to be
displayed even if those cookies were present, because _check_cookies()
did not account for an empty cookiedomain.
pull/2197/head
Mike Fährmann 3 years ago
parent 1e0278702d
commit 6f2e0c9c3d
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

@ -336,7 +336,8 @@ class Extractor():
now = time.time()
for cookie in self._cookiejar:
if cookie.name in names and cookie.domain == domain:
if cookie.name in names and (
not domain or cookie.domain == domain):
if cookie.expires and cookie.expires < now:
self.log.warning("Cookie '%s' has expired", cookie.name)
else:

@ -20,6 +20,7 @@ class PatreonExtractor(Extractor):
"""Base class for patreon extractors"""
category = "patreon"
root = "https://www.patreon.com"
cookiedomain = ".patreon.com"
directory_fmt = ("{category}", "{creator[full_name]}")
filename_fmt = "{id}_{title}_{num:>02}.{extension}"
archive_fmt = "{id}_{num}"

Loading…
Cancel
Save