aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/common.py
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2023-12-11 01:12:35 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2023-12-11 01:12:35 -0500
commit8f38aa2d53efca9b8daae2aa410772945f9869e1 (patch)
tree8df7cf0ae61fdeeffacb3fa96471d438f810680f /gallery_dl/extractor/common.py
parenteb0c801f2feccf351c740d44cd1406a8fad4e4d7 (diff)
parent30dee4697019389ef29458b2e3931adc976389b2 (diff)
Update upstream source from tag 'upstream/1.26.4'
Update to upstream version '1.26.4' with Debian dir d0660410628ead2b9c2c05196e8bb01d1b9961bc
Diffstat (limited to 'gallery_dl/extractor/common.py')
-rw-r--r--gallery_dl/extractor/common.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/gallery_dl/extractor/common.py b/gallery_dl/extractor/common.py
index f378427..9b010c5 100644
--- a/gallery_dl/extractor/common.py
+++ b/gallery_dl/extractor/common.py
@@ -136,6 +136,18 @@ class Extractor():
kwargs["timeout"] = self._timeout
if "verify" not in kwargs:
kwargs["verify"] = self._verify
+
+ if "json" in kwargs:
+ json = kwargs["json"]
+ if json is not None:
+ kwargs["data"] = util.json_dumps(json).encode()
+ del kwargs["json"]
+ headers = kwargs.get("headers")
+ if headers:
+ headers["Content-Type"] = "application/json"
+ else:
+ kwargs["headers"] = {"Content-Type": "application/json"}
+
response = None
tries = 1
@@ -233,7 +245,7 @@ class Extractor():
password = None
if username:
- password = self.config("password")
+ password = self.config("password") or util.LazyPrompt()
elif self.config("netrc", False):
try:
info = netrc.netrc().authenticators(self.category)