Skip to content

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

@heitumo

Description

@heitumo
  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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions