aboutsummaryrefslogtreecommitdiffstats
path: root/gallery_dl/extractor/common.py
diff options
context:
space:
mode:
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)