Skip to content

Commit

Permalink
feat: make mock first to check the api
Browse files Browse the repository at this point in the history
  • Loading branch information
sinkaroid committed May 12, 2022
1 parent 08be5b4 commit 91b1772
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions booru/client/danbooru.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ def __init__(self, api_key: str = "", login: str = ""):

self.specs = {"api_key": self.api_key, "login": self.login}

if self.api_key and self.login:
self.data = requests.get(f"https://danbooru.donmai.us/profile.json?api_key={self.api_key}&login={self.login}")

if self.data.status_code != 200:
raise ValueError(Booru.error_handling_invalid_auth)


async def search(
self,
query: str,
Expand Down

0 comments on commit 91b1772

Please # to comment.