From c3daa08537668c24224fffecbed4347fee936fcf Mon Sep 17 00:00:00 2001 From: a01200356 Date: Thu, 19 May 2016 00:38:43 -0500 Subject: [enh] Add onions category with Ahmia, Not Evil and Torch Xpath engine and results template changed to account for the fact that archive.org doesn't cache .onions, though some onion engines migth have their own cache. Disabled by default. Can be enabled by setting the SOCKS proxies to wherever Tor is listening and setting using_tor_proxy as True. Requires Tor and updating packages. To avoid manually adding the timeout on each engine, you can set extra_proxy_timeout to account for Tor's (or whatever proxy used) extra time. --- searx/templates/legacy/result_templates/default.html | 7 ++++++- searx/templates/oscar/macros.html | 12 ++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'searx/templates') diff --git a/searx/templates/legacy/result_templates/default.html b/searx/templates/legacy/result_templates/default.html index 13e2d2913..78bf031df 100644 --- a/searx/templates/legacy/result_templates/default.html +++ b/searx/templates/legacy/result_templates/default.html @@ -1,6 +1,11 @@

{% if "icon_"~result.engine~".ico" in favicons %}{{result.engine}}{% endif %}{{ result.title|safe }}

-

{{ result.pretty_url }}‎ {{ _('cached') }} +

{{ result.pretty_url }}‎ + {% if result.cached_url %} + {{ _('cached') }} + {% elif not result.is_onion %} + {{ _('cached') }} + {% endif %} {% if result.publishedDate %}{{ result.publishedDate }}{% endif %}

{% if result.img_src %}{% endif %}{% if result.content %}{{ result.content|safe }}
{% endif %}

diff --git a/searx/templates/oscar/macros.html b/searx/templates/oscar/macros.html index f52d9713c..57a90aaa2 100644 --- a/searx/templates/oscar/macros.html +++ b/searx/templates/oscar/macros.html @@ -32,7 +32,11 @@ {{ engine }} {%- endfor -%} {%- if result.url -%} - {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% if result.cached_url %} + {{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }} + {% elif not result.is_onion %} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% endif %} {%- endif -%} {%- if proxify -%} {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} @@ -50,7 +54,11 @@ {{ engine }} {%- endfor %} {%- if result.url -%} - {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% if result.cached_url %} + {{ result_link(result.cached_url, icon('link') + _('cached'), "text-info", id) }} + {% elif not result.is_onion %} + {{ result_link("https://web.archive.org/web/" + result.url, icon('link') + _('cached'), "text-info", id) }} + {% endif %} {%- endif -%} {% if proxify -%} {{ result_link(proxify(result.url), icon('sort') + _('proxied'), "text-info", id) }} -- cgit v1.2.3