From 07d02502411ef5097d3394e0615010461ec32878 Mon Sep 17 00:00:00 2001 From: Venca24 Date: Tue, 20 Aug 2019 16:10:25 +0200 Subject: [PATCH 1/2] [fix] mojeek engine --- searx/settings.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/searx/settings.yml b/searx/settings.yml index cf2b13e08..b162839ec 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -743,7 +743,7 @@ engines: title_xpath : ./h2 content_xpath : ./p[@class="s"] suggestion_xpath : /html/body//div[@class="top-info"]/p[@class="top-info spell"]/a - first_page_num : 1 + first_page_num : 0 page_size : 10 disabled : True From 5e5ff0cbf83fc6929545e1ca3f936a162019a2aa Mon Sep 17 00:00:00 2001 From: lorddavidiii Date: Sat, 16 Nov 2019 21:05:08 +0100 Subject: [PATCH 2/2] webapp.py: use html.escape if cgi.escape is not available - cgi.escape was removed in python 3.8 - also use html.escape in framalibre.py --- searx/engines/framalibre.py | 5 ++++- searx/webapp.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/searx/engines/framalibre.py b/searx/engines/framalibre.py index 146cdaeec..f3441fa5f 100644 --- a/searx/engines/framalibre.py +++ b/searx/engines/framalibre.py @@ -10,7 +10,10 @@ @parse url, title, content, thumbnail, img_src """ -from cgi import escape +try: + from cgi import escape +except: + from html import escape from lxml import html from searx.engines.xpath import extract_text from searx.url_utils import urljoin, urlencode diff --git a/searx/webapp.py b/searx/webapp.py index 3bb29140a..183bf1975 100644 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -41,7 +41,10 @@ except: logger.critical("cannot import dependency: pygments") from sys import exit exit(1) -from cgi import escape +try: + from cgi import escape +except: + from html import escape from datetime import datetime, timedelta from time import time from werkzeug.contrib.fixers import ProxyFix