jacklul / e621-Batch-Reverse-Search

Perform reverse search for all images in a directory (using e621.net/iqdb_queries, saucenao.com, fuzzysearch.net)
MIT License
56 stars 2 forks source link

Add option to limit search result in SauceNao #13

Closed soulspark666 closed 4 years ago

soulspark666 commented 4 years ago

Can you tell me what can I do to limit the results of the app to certain percentage of image similarity, like only show results above 80% in saucenao.

jacklul commented 4 years ago

Modify line 1001 in https://github.com/jacklul/e621-Batch-Reverse-Search/blob/master/src/app.php and add condition $this_result['header']['similarity'] > 80 and the build the app using build.php.

The line should look like:

if (isset($this_result['data']['ext_urls']) && $this_result['header']['similarity'] > 80) {
soulspark666 commented 4 years ago

I will try and report.

By the way is it possible to limit the search to saucenao rather than also searching on e621?

soulspark666 commented 4 years ago

I tried with your edit and its working. Thanks for the quick response.

soulspark666 commented 4 years ago

While using your script it cannot connect to iqdb.harry.lu Trying reverse search #1 (iqdb.harry.lu)... error: < So is it possible to skip it and search directly on saucenao.

soulspark666 commented 4 years ago

And I also found out that it is skipping out results from saucenao. Like for example this image _hLN6EmO8DM

It shows following result:

Generated by e621 Batch Reverse Search
_hLN6EmO8DM.jpg:
 https://danbooru.donmai.us/post/show/2846727 (saucenao.com) 

While there are more links in saucenao search result: https://gelbooru.com/index.php?page=post&s=view&id=3867471

jacklul commented 4 years ago

https://github.com/jacklul/e621-Batch-Reverse-Search/blob/master/src/app.php#L1192 Comment it out and add after $results = false;, should search with saucenao only.

It returns results returned by saucenao API, if results for same image are different for API and web search report the issue to them.

soulspark666 commented 4 years ago

https://github.com/jacklul/e621-Batch-Reverse-Search/blob/master/src/app.php#L1192 Comment it out and add after $results = false;, should search with saucenao only.

Getting too many errors if any pic is not found on saucenao. Since saucenao is rejecting requests after too many false search.

Thanks by the way. Will you be making such script for only saucenao, in future??

jacklul commented 4 years ago

If you're getting errors because of $this_result['header']['similarity'] addition try putting && isset($this_result['header']['similarity']) before comparison.

No, I will not be doing saucenao only version, feel free to fork this project and strip out the e621 search.

soulspark666 commented 4 years ago

Thanks for the quick reply. Will try to make a saucenao version.