Apply precommit
This commit is contained in:
parent
b940fab474
commit
919d6c2523
2 changed files with 12 additions and 4 deletions
|
@ -25,4 +25,3 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
types: [python]
|
types: [python]
|
||||||
|
|
||||||
|
|
15
main.py
15
main.py
|
@ -5,7 +5,6 @@ import sys
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
|
||||||
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -29,7 +28,15 @@ class PCloudClient:
|
||||||
email_sha = self._sha1(PCLOUD_USER_EMAIL.lower())
|
email_sha = self._sha1(PCLOUD_USER_EMAIL.lower())
|
||||||
logger.debug("email_sha: %s", email_sha)
|
logger.debug("email_sha: %s", email_sha)
|
||||||
password_digest = self._sha1(PCLOUD_USER_PASSWORD + email_sha + digest)
|
password_digest = self._sha1(PCLOUD_USER_PASSWORD + email_sha + digest)
|
||||||
return self._get("/userinfo", params={"getauth": 1, "digest": digest, "username": PCLOUD_USER_EMAIL, "passworddigest": password_digest})
|
return self._get(
|
||||||
|
"/userinfo",
|
||||||
|
params={
|
||||||
|
"getauth": 1,
|
||||||
|
"digest": digest,
|
||||||
|
"username": PCLOUD_USER_EMAIL,
|
||||||
|
"passworddigest": password_digest,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
|
||||||
def get_digest(self):
|
def get_digest(self):
|
||||||
return self._get("/getdigest").get("digest")
|
return self._get("/getdigest").get("digest")
|
||||||
|
@ -53,7 +60,9 @@ class PCloudClient:
|
||||||
return "https://api.pcloud.com"
|
return "https://api.pcloud.com"
|
||||||
elif PCLOUD_USER_REGION == "eu":
|
elif PCLOUD_USER_REGION == "eu":
|
||||||
return "https://eapi.pcloud.com"
|
return "https://eapi.pcloud.com"
|
||||||
raise ValueError("PCLOUD_USER_REGION doesn't contain a supported value. Supported values: [us, eu].")
|
raise ValueError(
|
||||||
|
"PCLOUD_USER_REGION doesn't contain a supported value. Supported values: [us, eu]."
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
Loading…
Reference in a new issue