diff options
| author | 2025-10-14 00:23:17 -0400 | |
|---|---|---|
| committer | 2025-10-14 00:23:17 -0400 | |
| commit | 926a7a86168620337d6912790e2695a4247af20b (patch) | |
| tree | 3e54d31b36ca9d1f50fc5519cdeee12e3387785d /gallery_dl/extractor/common.py | |
| parent | 6492496877fdfb186df50e3e30c66a0e18c395b6 (diff) | |
| parent | 33f8a8a37a9cba738ef25fb99955f0730da9eb48 (diff) | |
Update upstream source from tag 'upstream/1.30.10'
Update to upstream version '1.30.10'
with Debian dir e2322700edd83cfacc538c82b4928de8a169ad1a
Diffstat (limited to 'gallery_dl/extractor/common.py')
| -rw-r--r-- | gallery_dl/extractor/common.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py index 01965f3..34e65c5 100644 --- a/gallery_dl/extractor/common.py +++ b/gallery_dl/extractor/common.py @@ -228,7 +228,8 @@ class Extractor(): break finally: - Extractor.request_timestamp = time.time() + if interval: + Extractor.request_timestamp = time.time() self.log.debug("%s (%s/%s)", msg, tries, retries+1) if tries > retries: @@ -262,6 +263,7 @@ class Extractor(): def request_location(self, url, **kwargs): kwargs.setdefault("method", "HEAD") kwargs.setdefault("allow_redirects", False) + kwargs.setdefault("interval", False) return self.request(url, **kwargs).headers.get("location", "") def request_json(self, url, **kwargs): @@ -539,7 +541,7 @@ class Extractor(): elif isinstance(cookies_source, str): path = util.expand_path(cookies_source) try: - with open(path) as fp: + with open(path, encoding="utf-8") as fp: cookies = util.cookiestxt_load(fp) except ValueError as exc: self.log.warning("cookies: Invalid Netscape cookies.txt file " @@ -597,7 +599,7 @@ class Extractor(): path_tmp = path + ".tmp" try: - with open(path_tmp, "w") as fp: + with open(path_tmp, "w", encoding="utf-8") as fp: util.cookiestxt_store(fp, self.cookies) os.replace(path_tmp, path) except OSError as exc: |
