sinkaroid / booru

Python bindings for booru imageboards
https://sinkaroid.github.io/booru
MIT License
24 stars 3 forks source link

Danbooru Api Key Login throws Key 0 #1

Closed MemoriVR closed 2 years ago

MemoriVR commented 2 years ago

Describe the bug Using the Api key and the user_id to log into danbooru will not work the error: Traceback (most recent call last): File "test.py", line 10, in asyncio.run(main()) File "C:\anaconda\envs\bot\lib\asyncio\runners.py", line 43, in run return loop.run_until_complete(main) File "C:\anaconda\envs\bot\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "test.py", line 6, in main res = await dan.search(query="cat_girl", limit=1) File "C:\anaconda\envs\bot\lib\site-packages\booru\client\danbooru.py", line 130, in search self.not_random = Danbooru.append_obj(self.final) File "C:\anaconda\envs\bot\lib\site-packages\booru\client\danbooru.py", line 38, in append_obj if "id" in raw_object[i]: KeyError: 0

To Reproduce Intitialize Danbooru exactly like the documentation instructs. using the username or number only user ID will not work Gelbooru works however

Expected behavior A clear and concise description of what you expected to happen.

Desktop (please complete the following information):

Additional context

sinkaroid commented 2 years ago

Hi, thanks for reporting and fixed already. It is because danbooru:docs required parameter login instead user_id

also i have tests stuff without api auth so login properties may not same it all, If you encounter this misleading in another booru please open an issue again