From 6d5580e50d9fb8de3fd367a082cac2a8d814e1d2 Mon Sep 17 00:00:00 2001 From: Joseph Cheung Date: Wed, 1 Mar 2023 18:45:55 +0800 Subject: [PATCH] d --- searx/webapp.py | 862 ++++++++++++++++++++++++++++++++++++++++++++++- searx/webapp1.py | 6 +- 2 files changed, 866 insertions(+), 2 deletions(-) diff --git a/searx/webapp.py b/searx/webapp.py index 25a4b0b63..95653fe00 100755 --- a/searx/webapp.py +++ b/searx/webapp.py @@ -1181,7 +1181,867 @@ const search_type = "''' + search_type + r'''" const net_search = ''' + net_search_str + r''' ''' diff --git a/searx/webapp1.py b/searx/webapp1.py index 802376dce..95653fe00 100644 --- a/searx/webapp1.py +++ b/searx/webapp1.py @@ -1230,10 +1230,14 @@ function modal_open(url, num) var iframe = document.querySelector("#iframe-wrapper > iframe"); let modalele = eleparse(iframe.contentDocument); let article = new Readability(iframe.contentDocument.cloneNode(true)).parse(); + let fulltext = article.textContent; + fulltext.replaceAll("\n\n","\n").replaceAll("\n\n","\n"); + const delimiter = /[?!;\?\n。;!………]/g + fulltext = fulltext.split(delimiter); optkeytext = { method: "POST", headers: headers, - body: JSON.stringify({'text':article.textContent}) + body: JSON.stringify({'text':fulltext.join("\n")}) }; fetchRetry('https://search.kg/keytext',3,optkeytext) .then(response => response.json())