use custom HTTPBasicAuth class

to support LazyPrompt as password
and to generate the Authorization header only once
instead of for every request
This commit is contained in:
Mike Fährmann
2023-12-06 23:39:23 +01:00
parent bdebe4597a
commit e256434c9e
6 changed files with 20 additions and 6 deletions

View File

@@ -1239,7 +1239,7 @@ class DeviantartOAuthAPI():
self.log.info("Requesting public access token")
data = {"grant_type": "client_credentials"}
auth = (self.client_id, self.client_secret)
auth = util.HTTPBasicAuth(self.client_id, self.client_secret)
response = self.extractor.request(
url, method="POST", data=data, auth=auth, fatal=False)
data = response.json()