Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

saucenao_api.errors.UnknownClientError: Unknown client error, status < 0 #18

Open
heitumo opened this issue Oct 12, 2022 · 3 comments · May be fixed by #19
Open

saucenao_api.errors.UnknownClientError: Unknown client error, status < 0 #18

heitumo opened this issue Oct 12, 2022 · 3 comments · May be fixed by #19
Assignees
Labels
bug Something isn't working

Comments

@heitumo
Copy link

heitumo commented Oct 12, 2022

  File "/Users/x/dev/pysaucenaonao/ex.py", line 9, in main
    results = await aio.from_file('/users/x/desktop/p0583.jpg')
  File "/usr/local/lib/python3.10/site-packages/saucenao_api/saucenao_api.py", line 125, in from_file
    return await self._search(self.params, {'file': file})
  File "/usr/local/lib/python3.10/site-packages/saucenao_api/saucenao_api.py", line 144, in _search
    raw = self._verify_response(parsed_resp, params)
  File "/usr/local/lib/python3.10/site-packages/saucenao_api/saucenao_api.py", line 173, in _verify_response
    raise UnknownClientError('Unknown client error, status < 0')
saucenao_api.errors.UnknownClientError: Unknown client error, status < 0

with code below:

import asyncio
from saucenao_api import AIOSauceNao

async def main():
    # async requesting is also supported via the AIOSauceNao class
    async with AIOSauceNao('API code get from offical site') as aio:
        #results = sauce.from_url('https://i.imgur.com/oZjCxGo.jpg')  # or from_file()
        #results = await aio.from_url('https://i.imgur.com/oZjCxGo.jpg')
        results = await aio.from_file('/users/x/desktop/p0583.jpg')
        best = results[0]
        print(results)
    
asyncio.run(main())

But from_url is ok. got such result:

pysaucenaonao % python3 ex.py
<SauceResponse(count=6, long_remaining=83, short_remaining=3)>

where changed

  #results = await aio.from_url('https://i.imgur.com/oZjCxGo.jpg')
        results = await aio.from_file('/users/x/desktop/p0583.jpg')

to

    results = await aio.from_url('https://i.imgur.com/oZjCxGo.jpg')
     #   results = await aio.from_file('/users/x/desktop/p0583.jpg')

Thank you.

@nomnoms12 nomnoms12 added the bug Something isn't working label Oct 12, 2022
@nomnoms12 nomnoms12 self-assigned this Oct 12, 2022
@DewasSquid
Copy link

I made a pull request that fixed this bug

@nomnoms12
Copy link
Owner

@DewasSquid Hi! Thank you for your attention.

I'm very busy and can't make time for it right now 😔. But I will try to look into the bug and see your PR early next week

@nomnoms12 nomnoms12 linked a pull request Dec 27, 2022 that will close this issue
@Isaias-F
Copy link

Isaias-F commented Jul 6, 2023

There is a new PR, it would be great if you can review it.
@nomnoms12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants