SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[fix] recoll engine: fix media preview
Hermógenes Oliveiraaf111e413cc8
diff --git a/searx/engines/recoll.py b/searx/engines/recoll.pyindex ee97f330d..c9e85344c 100644--- a/searx/engines/recoll.py+++ b/searx/engines/recoll.py@@ -38,7 +38,7 @@ Implementationsimport typing as tfrom datetime import date, timedelta-from urllib.parse import urlencode, quote+from urllib.parse import urlencodefrom searx.result_types import EngineResults@@ -122,15 +122,14 @@ def response(resp: "SXNG_Response") -> EngineResults:url = result.get("url", "").replace("file://" + mount_prefix, dl_prefix)- mtype = subtype = result.get("mime", "")+ mtype = subtype = result.get("mtype", "")if mtype:mtype, subtype = (mtype.split("/", 1) + [""])[:2]# facilitate preview support for known mime typesthumbnail = embedded = ""if mtype in ["audio", "video"]:- embedded_url = '<{ttype} controls height="166px" ' + 'src="{url}" type="{mtype}"></{ttype}>'- embedded = embedded_url.format(ttype=mtype, url=quote(url.encode("utf8"), "/:"), mtype=result["mtype"])+ embedded = urlif mtype in ["image"] and subtype in ["bmp", "gif", "jpeg", "png"]:thumbnail = url