Skip to content
This repository has been archived by the owner on Sep 7, 2023. It is now read-only.

[enh] Add Tineye reverse image search #3040

Merged
merged 8 commits into from
Jan 22, 2022
Merged

Conversation

allendema
Copy link
Contributor

What does this PR do?

Adds Tineye engine for reverse image searching.

Simply paste the URL of the image you want to search for.

Why is this change important?

Add an engine for reverse image searching.

Make searX better.

How to test this PR locally?

!tin https://asteroidos.org/public/img/logo.png

Author's checklist

Other optional parametesr:

&sort=crawl_date can be appended to search_string to sort results by date.
&domain=example.org can be implemented to search_string in order to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

Check if the shorcut is alright.

Related issues

#2962
#1895

Example

Tineye in Action

tineye_showcase

Other optional parametesr:

"&sort=crawl_date" can be appended to search_string to sort results by date.
"&domain=example.org" can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.
Check if that's the right shortcut.
return42 pushed a commit to return42/searxng that referenced this pull request Nov 4, 2021
Other optional parameter ..

`&sort=crawl_date`
    can be appended to search_string to sort results by date.

`&domain=example.org`
    can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

--

Merged from @allendema's commit [1] and slightly modfied / see [2].

Related-to: [1] allendema/searx@455b2b4
Related-to: [2] searx/searx#3040
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 pushed a commit to return42/searxng that referenced this pull request Nov 4, 2021
Other optional parameter ..

`&sort=crawl_date`
    can be appended to search_string to sort results by date.

`&domain=example.org`
    can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

--

Merged from @allendema's commit [1] and slightly modfied / see [2].

Related-to: [1] allendema/searx@455b2b4
Related-to: [2] searx/searx#3040
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@kvch
Copy link
Member

kvch commented Nov 14, 2021

Could you please rebase and fix the pylint issues with the PR?

@kvch
Copy link
Member

kvch commented Jan 7, 2022

Sorry for only getting back to you now. I have just tested the engine with the example you provided in the PR description and I get this backtrace:

ERROR:searx.search.processor.online:engine tineye : requests exception(search duration : 1.6560711860656738 s, timeout: 9.0 s) : 400 Client Error: Bad Request for url: https://tineye.com/result_json/?page=1&url=https%3A%2F%2Fa
steroidos.org%2Fpublic%2Fimg%2Flogo.png
For more information check: https://httpstatuses.com/400
Traceback (most recent call last):
  File "/home/n/p/searx/searx/search/processors/online.py", line 139, in search
    search_results = self._search_basic(query, params)
  File "/home/n/p/searx/searx/search/processors/online.py", line 119, in _search_basic
    response = self._send_http_request(params)
  File "/home/n/p/searx/searx/search/processors/online.py", line 91, in _send_http_request
    response = req(params['url'], **request_args)
  File "/home/n/p/searx/searx/network/__init__.py", line 126, in get
    return request('get', url, **kwargs)
  File "/home/n/p/searx/searx/network/__init__.py", line 119, in request
    raise_for_httperror(response)
  File "/home/n/p/searx/searx/network/raise_for_httperror.py", line 66, in raise_for_httperror
    resp.raise_for_status()
  File "/home/n/p/searx/venv3.9/lib/python3.9/site-packages/httpx/_models.py", line 1105, in raise_for_status
    raise HTTPStatusError(message, request=request, response=self)
httpx.HTTPStatusError: 400 Client Error: Bad Request for url: https://tineye.com/result_json/?page=1&url=https%3A%2F%2Fasteroidos.org%2Fpublic%2Fimg%2Flogo.png

Could you please address this problem or let me know what I am doing wrong?

@allendema
Copy link
Contributor Author

Nothing is wrong but it happend that the query was to simple.
error: "Too Simple"

Different image must work.

Just keep in mind that if many requests are detected and timeout will be posed by Tineye.

@kvch kvch added this to TODO in Next release Jan 16, 2022
@kvch kvch merged commit 0c351ea into searx:master Jan 22, 2022
Next release automation moved this from TODO to DONE Jan 22, 2022
return42 pushed a commit to return42/searxng that referenced this pull request Jan 25, 2022
Other optional parameter ..

`&sort=crawl_date`
    can be appended to search_string to sort results by date.

`&domain=example.org`
    can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

--

Merged from @allendema's commit [1] and slightly modfied / see [2].

Related-to: [1] allendema/searx@455b2b4
Related-to: [2] searx/searx#3040
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 pushed a commit to return42/searxng that referenced this pull request Jan 25, 2022
Other optional parameter ..

`&sort=crawl_date`
    can be appended to search_string to sort results by date.

`&domain=example.org`
    can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

--

Merged from @allendema's commit [1] and slightly modfied / see [2].

Related-to: [1] allendema/searx@455b2b4
Related-to: [2] searx/searx#3040
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 pushed a commit to return42/searxng that referenced this pull request Jan 28, 2022
Other optional parameter ..

`&sort=crawl_date`
    can be appended to search_string to sort results by date.

`&domain=example.org`
    can be implemented to search_string to get results from just one domain.

Public instances could get relatively fast timed-out for 3600s.

--

Merged from @allendema's commit [1] and slightly modfied / see [2].

Related-to: [1] allendema/searx@455b2b4
Related-to: [2] searx/searx#3040
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants