nomnoms12 / saucenao_api Goto Github PK
View Code? Open in Web Editor NEWWrapper for SauceNAO JSON API
Home Page: https://pypi.org/project/saucenao-api
License: GNU General Public License v3.0
Wrapper for SauceNAO JSON API
Home Page: https://pypi.org/project/saucenao-api
License: GNU General Public License v3.0
i though so because it has the option called frame
??
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?
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.
#10 adds basic support for async operations. We need to add automated tests to make sure the code works.
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.
We need to test new DB's (which were added in #7):
This requires:
Optionally, we also need to update the existing test cases to be up to date.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.