diff options
| author | 2023-03-13 02:07:49 -0400 | |
|---|---|---|
| committer | 2023-03-13 02:07:49 -0400 | |
| commit | 10987f08f8b6c510ba64f4b42d95ba67eec6e5b0 (patch) | |
| tree | 1af82cad9ac859a70cafc976a980280b939cfcc7 /gallery_dl/cookies.py | |
| parent | 919f8ba16a7b82ba1099bd25b2c61c7881a05aa2 (diff) | |
New upstream version 1.25.0.upstream/1.25.0
Diffstat (limited to 'gallery_dl/cookies.py')
| -rw-r--r-- | gallery_dl/cookies.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gallery_dl/cookies.py b/gallery_dl/cookies.py index f18cc47..3d715a7 100644 --- a/gallery_dl/cookies.py +++ b/gallery_dl/cookies.py @@ -12,7 +12,6 @@ import binascii import contextlib import ctypes -import json import logging import os import shutil @@ -24,7 +23,7 @@ import tempfile from datetime import datetime, timedelta, timezone from hashlib import pbkdf2_hmac from http.cookiejar import Cookie -from . import aes, text +from . import aes, text, util SUPPORTED_BROWSERS_CHROMIUM = { @@ -169,8 +168,8 @@ def _firefox_cookies_database(profile=None, container=None): os.path.dirname(path), "containers.json") try: - with open(containers_path) as containers: - identities = json.load(containers)["identities"] + with open(containers_path) as file: + identities = util.json_loads(file.read())["identities"] except OSError: logger.error("Unable to read Firefox container database at %s", containers_path) @@ -716,8 +715,8 @@ def _get_windows_v10_key(browser_root): logger.error("could not find local state file") return None logger.debug("Found local state file at '%s'", path) - with open(path, encoding="utf8") as f: - data = json.load(f) + with open(path, encoding="utf-8") as file: + data = util.json_loads(file.read()) try: base64_key = data["os_crypt"]["encrypted_key"] except KeyError: @@ -794,7 +793,8 @@ class DatabaseCopy(): def __init__(self, path): self.path = path - self.directory = self.database = None + self.database = None + self.directory = None def __enter__(self): try: |
