Giter VIP home page Giter VIP logo

saucenao_api's Introduction

Hi there 👋

Профиль участника nomnoms12 на сайте «Stack Overflow на русском», Вопросы и ответы для программистов

saucenao_api's People

Contributors

bakashigure avatar rubinduck avatar spoopcity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

saucenao_api's Issues

Unknown API error, status > 0

Everytime I do anything, it gives me this error:
Unknown API error, status > 0
But if I try to do the exact same thing but with python's requests module, it still gives me 3 for the status, but it works fine. Still gives me results.

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

  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.

Invalid API key

Got this error when running this code snippet

Error

Exception has occurred: BadKeyError
Invalid API key
  File "C:\Users\Admin\Projects\test.py", line 4, in <module>
    results = sauce.from_url('https://i.imgur.com/oZjCxGo.jpg')  # or from_file()

Code

from saucenao_api import SauceNao

sauce = SauceNao()
results = sauce.from_url('https://i.imgur.com/oZjCxGo.jpg')  # or from_file()

best = results[0]  # results sorted by similarity
print(best.author)

Do I need to provide an API key or something?

No URLs

I got this error when I am trying to find the URL.

Error

Traceback (most recent call last):
  File "ExtDel.py", line 7, in <module>
    print(best.urls[0])
IndexError: list index out of range

Code

from saucenao_api import SauceNao

sauce = SauceNao('18007b616a0808aa80ae9e17e3a8d110e53b081c')
results = sauce.from_url('https://cdn.discordapp.com/attachments/746709460709277707/871381898298019870/228101990_1241039109669568_5485442942218520916_n.png')

best = results[0]
print(best.urls[0])

Other images works just fine.

Test new DB's

We need to test new DB's (which were added in #7):

  • ArtStation (39)
  • FurAffinity (40)
  • Twitter (41)
  • Furry Network (42)

This requires:

  1. Add test cases to test_suite.py
  2. Add tests to test_containers.py

Optionally, we also need to update the existing test cases to be up to date.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.