From 30dee4697019389ef29458b2e3931adc976389b2 Mon Sep 17 00:00:00 2001 From: Unit 193 Date: Mon, 11 Dec 2023 01:12:30 -0500 Subject: New upstream version 1.26.4. --- gallery_dl/extractor/common.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gallery_dl/extractor/common.py') 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) -- cgit v1.2.3