Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: wikicommons.images #2707

Closed
bonswouar opened this issue Sep 2, 2023 · 1 comment · Fixed by #2708
Closed

Bug: wikicommons.images #2707

bonswouar opened this issue Sep 2, 2023 · 1 comment · Fixed by #2708
Labels
bug Something isn't working

Comments

@bonswouar
Copy link
Contributor

bonswouar commented Sep 2, 2023

Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG
2023.9.2+4f8895c6d

How did you install SearXNG?
Docker from official wiki

What happened?
I always get 0 result with wikicommons images (but no error)

How To Reproduce
!wc birds

Expected behavior
Should return results

Screenshots & Logs

searxng    | DEBUG   searx.engines.wikicommons.imag: HTTP Accept-Language:
searxng    | DEBUG   searx.search                  : actual_timeout=3.0 (default_timeout=3.0, ?timeout_limit=None, max_request_timeout=None)
searxng    | DEBUG   searx.network.wikicommons.imag: HTTP Request: GET https://commons.wikimedia.org/w/api.php?action=query&format=json&generator=search&gsrnamespace=6&gsrprop=snippet&prop=info%7Cimageinfo&iiprop=url%7Csize%7Cmime&iiurlheight=180&uselang=en&gsrlimit=10&gsroffset=0&gsrsearch=filetype%253Abitmap%257Cdrawing+birds "HTTP/2 200 OK" (application/json; charset=utf-8)

Additional context
It seems to be because of https://github.com/searxng/searxng/blob/master/searx/engines/wikicommons.py#L43
For some reason it gets url encoded twice, resulting in filetype%253Abitmap%257Cdrawing+birds instead of filetype%3Abitmap%7Cdrawing+birds (see logs)

@bonswouar bonswouar added the bug Something isn't working label Sep 2, 2023
return42 added a commit to return42/searxng that referenced this issue Sep 3, 2023
From [1]: It seems to be because of [2] For some reason it gets url encoded
twice, resulting in

- ``filetype%253Abitmap%257Cdrawing+birds`` instead of
- ``filetype:bitmap%7Cdrawing+birds``

[1] searxng#2707
[2] https://github.com/searxng/searxng/blob/master/searx/engines/wikicommons.py#L43

Closes: searxng#2707
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
@return42
Copy link
Member

return42 commented Sep 3, 2023

@bonswouar thanks for early testing and your deep analysis, which was very helpful to me 👍 .. seems we should better not url-quote : and | --> I send PR #2708 to fix this issue, if you would have a look ..

return42 added a commit that referenced this issue Sep 3, 2023
From [1]: It seems to be because of [2] For some reason it gets url encoded
twice, resulting in

- ``filetype%253Abitmap%257Cdrawing+birds`` instead of
- ``filetype:bitmap%7Cdrawing+birds``

[1] #2707
[2] https://github.com/searxng/searxng/blob/master/searx/engines/wikicommons.py#L43

Closes: #2707
Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants