diff options
21 files changed, 217 insertions, 106 deletions
diff --git a/dockerfiles/docker-entrypoint.sh b/dockerfiles/docker-entrypoint.sh index efd54016e..332d5c2bb 100755 --- a/dockerfiles/docker-entrypoint.sh +++ b/dockerfiles/docker-entrypoint.sh @@ -61,6 +61,12 @@ echo "SearXNG version ${SEARXNG_VERSION}" # helpers to update the configuration files patch_uwsgi_settings() { CONF="$1" + + # update uwsg.ini + sed -i \ + -e "s|workers = .*|workers = ${UWSGI_WORKERS:-%k}|g" \ + -e "s|threads = .*|threads = ${UWSGI_THREADS:-4}|g" \ + "${CONF}" } patch_searxng_settings() { diff --git a/requirements.txt b/requirements.txt index fe57051c1..2de33f4ba 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,7 +12,7 @@ Brotli==1.0.9 uvloop==0.17.0 httpx-socks[asyncio]==0.7.2 setproctitle==1.3.2 -redis==4.4.0 +redis==4.4.2 markdown-it-py==2.1.0 typing_extensions==4.4.0 fasttext-predict==0.9.2.1 diff --git a/searx/exceptions.py b/searx/exceptions.py index 43c8bab40..af81bfb23 100644 --- a/searx/exceptions.py +++ b/searx/exceptions.py @@ -69,11 +69,19 @@ class SearxEngineAPIException(SearxEngineResponseException): class SearxEngineAccessDeniedException(SearxEngineResponseException): """The website is blocking the access""" - def __init__(self, suspended_time=24 * 3600, message='Access denied'): + SUSPEND_TIME_SETTING = "search.suspended_times.SearxEngineAccessDenied" + + def __init__(self, suspended_time=None, message='Access denied'): + suspended_time = suspended_time or self._get_default_suspended_time() super().__init__(message + ', suspended_time=' + str(suspended_time)) self.suspended_time = suspended_time self.message = message + def _get_default_suspended_time(self): + from searx import get_setting + + return get_setting(self.SUSPEND_TIME_SETTING) + class SearxEngineCaptchaException(SearxEngineAccessDeniedException): """The website has returned a CAPTCHA @@ -81,7 +89,9 @@ class SearxEngineCaptchaException(SearxEngineAccessDeniedException): By default, searx stops sending requests to this engine for 1 day. """ - def __init__(self, suspended_time=24 * 3600, message='CAPTCHA'): + SUSPEND_TIME_SETTING = "search.suspended_times.SearxEngineCaptcha" + + def __init__(self, suspended_time=None, message='CAPTCHA'): super().__init__(message=message, suspended_time=suspended_time) @@ -91,7 +101,9 @@ class SearxEngineTooManyRequestsException(SearxEngineAccessDeniedException): By default, searx stops sending requests to this engine for 1 hour. """ - def __init__(self, suspended_time=3600, message='Too many request'): + SUSPEND_TIME_SETTING = "search.suspended_times.SearxEngineTooManyRequests" + + def __init__(self, suspended_time=None, message='Too many request'): super().__init__(message=message, suspended_time=suspended_time) diff --git a/searx/network/raise_for_httperror.py b/searx/network/raise_for_httperror.py index 414074977..7fc2b7877 100644 --- a/searx/network/raise_for_httperror.py +++ b/searx/network/raise_for_httperror.py @@ -9,6 +9,7 @@ from searx.exceptions import ( SearxEngineTooManyRequestsException, SearxEngineAccessDeniedException, ) +from searx import get_setting def is_cloudflare_challenge(resp): @@ -33,15 +34,22 @@ def raise_for_cloudflare_captcha(resp): if is_cloudflare_challenge(resp): # https://support.cloudflare.com/hc/en-us/articles/200170136-Understanding-Cloudflare-Challenge-Passage-Captcha- # suspend for 2 weeks - raise SearxEngineCaptchaException(message='Cloudflare CAPTCHA', suspended_time=3600 * 24 * 15) + raise SearxEngineCaptchaException( + message='Cloudflare CAPTCHA', suspended_time=get_setting('search.suspended_times.cf_SearxEngineCaptcha') + ) if is_cloudflare_firewall(resp): - raise SearxEngineAccessDeniedException(message='Cloudflare Firewall', suspended_time=3600 * 24) + raise SearxEngineAccessDeniedException( + message='Cloudflare Firewall', + suspended_time=get_setting('search.suspended_times.cf_SearxEngineAccessDenied'), + ) def raise_for_recaptcha(resp): if resp.status_code == 503 and '"https://www.google.com/recaptcha/' in resp.text: - raise SearxEngineCaptchaException(message='ReCAPTCHA', suspended_time=3600 * 24 * 7) + raise SearxEngineCaptchaException( + message='ReCAPTCHA', suspended_time=get_setting('search.suspended_times.recaptcha_SearxEngineCaptcha') + ) def raise_for_captcha(resp): diff --git a/searx/settings.yml b/searx/settings.yml index 7efaf33e8..81025d653 100644 --- a/searx/settings.yml +++ b/searx/settings.yml @@ -45,6 +45,20 @@ search: ban_time_on_fail: 5 # max ban time in seconds after engine errors max_ban_time_on_fail: 120 + suspend_times: + # Engine suspension time after error (in seconds; set to 0 to disable) + # For error "Access denied" and "HTTP error [402, 403]" + SearxEngineAccessDenied: 86400 + # For error "CAPTCHA" + SearxEngineCaptcha: 86400 + # For error "Too many request" and "HTTP error 429" + SearxEngineTooManyRequests: 3600 + # Cloudflare CAPTCHA + cf_SearxEngineCaptcha: 1296000 + cf_SearxEngineAccessDenied: 86400 + # ReCAPTCHA + recaptcha_SearxEngineCaptcha: 604800 + # remove format to deny access, use lower case. # formats: [html, csv, json, rss] formats: diff --git a/searx/settings_defaults.py b/searx/settings_defaults.py index cfa1bb47c..7baa23cac 100644 --- a/searx/settings_defaults.py +++ b/searx/settings_defaults.py @@ -160,6 +160,14 @@ SCHEMA = { 'languages': SettingSublistValue(LANGUAGE_CODES, LANGUAGE_CODES), 'ban_time_on_fail': SettingsValue(numbers.Real, 5), 'max_ban_time_on_fail': SettingsValue(numbers.Real, 120), + 'suspended_times': { + 'SearxEngineAccessDenied': SettingsValue(numbers.Real, 86400), + 'SearxEngineCaptcha': SettingsValue(numbers.Real, 86400), + 'SearxEngineTooManyRequests': SettingsValue(numbers.Real, 3600), + 'cf_SearxEngineCaptcha': SettingsValue(numbers.Real, 1296000), + 'cf_SearxEngineAccessDenied': SettingsValue(numbers.Real, 86400), + 'recaptcha_SearxEngineCaptcha': SettingsValue(numbers.Real, 604800), + }, 'formats': SettingsValue(list, OUTPUT_FORMATS), }, 'server': { diff --git a/searx/translations/ar/LC_MESSAGES/messages.mo b/searx/translations/ar/LC_MESSAGES/messages.mo Binary files differindex c34334e7c..48e04923f 100644 --- a/searx/translations/ar/LC_MESSAGES/messages.mo +++ b/searx/translations/ar/LC_MESSAGES/messages.mo diff --git a/searx/translations/ar/LC_MESSAGES/messages.po b/searx/translations/ar/LC_MESSAGES/messages.po index f2189d760..f00b49612 100644 --- a/searx/translations/ar/LC_MESSAGES/messages.po +++ b/searx/translations/ar/LC_MESSAGES/messages.po @@ -6,7 +6,7 @@ # ButterflyOfFire ButterflyOfFire, 2018 # ButterflyOfFire, 2018 # d506c013dc1b502e7a53f91ebcbf8f29_985b4b3, 2017-2018 -# Markus Heiser <markus.heiser@darmarit.de>, 2022. +# Markus Heiser <markus.heiser@darmarit.de>, 2022, 2023. # ken kailer <kenkailer@yahoo.com>, 2022. # George Kashkosh <kash.george@gmail.com>, 2022. # Droid <droidpy587@gmail.com>, 2022. @@ -15,8 +15,8 @@ msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2022-12-30 07:14+0000\n" -"Last-Translator: Droid <droidpy587@gmail.com>\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" +"Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" "Language-Team: Arabic <https://weblate.bubu1.eu/projects/searxng/searxng/ar/>" "\n" "Language: ar\n" @@ -320,13 +320,12 @@ msgid "Night" msgstr "ليلا" #: searx/plugins/autodetect_search_language.py:79 -#, fuzzy msgid "Autodetect search language" -msgstr "البحث التلقائي للغة" +msgstr "كشف تلقائي عن لغة البحث" #: searx/plugins/autodetect_search_language.py:80 msgid "Automatically detect the query search language and switch to it." -msgstr "" +msgstr "كشف تلقائي عن لغة البحث والتبديل إليها." #: searx/plugins/hash_plugin.py:24 msgid "Converts strings to different hash digests." @@ -1142,7 +1141,7 @@ msgstr "تاريخ النشر" #: searx/templates/simple/result_templates/paper.html:9 msgid "Journal" -msgstr "" +msgstr "السجل اليومي" #: searx/templates/simple/result_templates/paper.html:22 msgid "Editor" @@ -1162,11 +1161,11 @@ msgstr "السمات" #: searx/templates/simple/result_templates/paper.html:26 msgid "DOI" -msgstr "" +msgstr "DOI" #: searx/templates/simple/result_templates/paper.html:27 msgid "ISSN" -msgstr "" +msgstr "ISSN" #: searx/templates/simple/result_templates/paper.html:28 msgid "ISBN" diff --git a/searx/translations/eu/LC_MESSAGES/messages.mo b/searx/translations/eu/LC_MESSAGES/messages.mo Binary files differindex bd14f8526..db18f3216 100644 --- a/searx/translations/eu/LC_MESSAGES/messages.mo +++ b/searx/translations/eu/LC_MESSAGES/messages.mo diff --git a/searx/translations/eu/LC_MESSAGES/messages.po b/searx/translations/eu/LC_MESSAGES/messages.po index 45dc9e9e2..1c1db7027 100644 --- a/searx/translations/eu/LC_MESSAGES/messages.po +++ b/searx/translations/eu/LC_MESSAGES/messages.po @@ -8,20 +8,22 @@ # beriain, 2020-2021 # Txopi <txopi@ikusimakusi.eus>, 2016 # beriain <soila@disroot.org>, 2022. +# Markus Heiser <markus.heiser@darmarit.de>, 2023. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2022-09-11 22:50+0000\n" -"Last-Translator: beriain <soila@disroot.org>\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" +"Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" +"Language-Team: Basque <https://weblate.bubu1.eu/projects/searxng/searxng/eu/>" +"\n" "Language: eu\n" -"Language-Team: Basque " -"<https://weblate.bubu1.eu/projects/searxng/searxng/eu/>\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" "Generated-By: Babel 2.11.0\n" #. CONSTANT_NAMES['DEFAULT_GROUP_NAME'] @@ -127,7 +129,7 @@ msgstr "software wikiak" #. CATEGORY_GROUPS['WEB'] #: searx/searxng.msg msgid "web" -msgstr "" +msgstr "web" #. CATEGORY_GROUPS['SCIENTIFIC PUBLICATIONS'] #: searx/searxng.msg @@ -1476,4 +1478,3 @@ msgstr "ezkutatu bideoa" #~ "href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\"" #~ " rel=\"external\">ikasi gehiago eskaera metodoen" #~ " inguruan</a>" - diff --git a/searx/translations/fa_IR/LC_MESSAGES/messages.mo b/searx/translations/fa_IR/LC_MESSAGES/messages.mo Binary files differindex 7aae9b394..2a5549285 100644 --- a/searx/translations/fa_IR/LC_MESSAGES/messages.mo +++ b/searx/translations/fa_IR/LC_MESSAGES/messages.mo diff --git a/searx/translations/fa_IR/LC_MESSAGES/messages.po b/searx/translations/fa_IR/LC_MESSAGES/messages.po index 5a2fbc6d3..34fbe2b3f 100644 --- a/searx/translations/fa_IR/LC_MESSAGES/messages.po +++ b/searx/translations/fa_IR/LC_MESSAGES/messages.po @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2023-01-06 07:14+0000\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" "Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" "Language-Team: Persian <https://weblate.bubu1.eu/projects/searxng/searxng/fa/" ">\n" @@ -95,7 +95,7 @@ msgstr "علم" #. CATEGORY_GROUPS['APPS'] #: searx/searxng.msg msgid "apps" -msgstr "برنامکها" +msgstr "برنامه ها" #. CATEGORY_GROUPS['DICTIONARIES'] #: searx/searxng.msg @@ -170,7 +170,7 @@ msgstr "خطای شبکه" #: searx/webapp.py:169 msgid "SSL error: certificate validation has failed" -msgstr "ارور SSL:اعتبار سنجی گواهی ناموفق بود" +msgstr "ارور SSL:اعتبار سنجی گواهی امنیتی SSL ناموفق بود" #: searx/webapp.py:171 msgid "unexpected crash" @@ -198,7 +198,7 @@ msgstr "درخواستهای زیاد" #: searx/webapp.py:188 msgid "access denied" -msgstr "دسترسی ممنوع است" +msgstr "دسترسی مجاز نیست" #: searx/webapp.py:189 msgid "server API error" @@ -219,7 +219,7 @@ msgstr "خطا در بارگزاری صفحه جدید" #: searx/webapp.py:522 searx/webapp.py:954 msgid "Invalid settings, please edit your preferences" -msgstr "تنظیمات نادرست است، لطفا پیشفرضهای جستجو را تغییر دهید" +msgstr "تنظیمات نادرست است، لطفا تنظیمات جستجو را تغییر دهید" #: searx/webapp.py:538 msgid "Invalid settings" diff --git a/searx/translations/fi/LC_MESSAGES/messages.mo b/searx/translations/fi/LC_MESSAGES/messages.mo Binary files differindex e3a021254..8afe658dd 100644 --- a/searx/translations/fi/LC_MESSAGES/messages.mo +++ b/searx/translations/fi/LC_MESSAGES/messages.mo diff --git a/searx/translations/fi/LC_MESSAGES/messages.po b/searx/translations/fi/LC_MESSAGES/messages.po index 965a2575f..009d8a468 100644 --- a/searx/translations/fi/LC_MESSAGES/messages.po +++ b/searx/translations/fi/LC_MESSAGES/messages.po @@ -4,22 +4,23 @@ # # Translators: # Jiri Grönroos <jiri.gronroos@iki.fi>, 2017 -# Markus Heiser <markus.heiser@darmarit.de>, 2022. +# Markus Heiser <markus.heiser@darmarit.de>, 2022, 2023. # Mico Hautaluoma <m@mha.fi>, 2022. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2022-10-11 13:31+0000\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" "Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" +"Language-Team: Finnish <https://weblate.bubu1.eu/projects/searxng/searxng/fi/" +">\n" "Language: fi\n" -"Language-Team: Finnish " -"<https://weblate.bubu1.eu/projects/searxng/searxng/fi/>\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.14.1\n" "Generated-By: Babel 2.11.0\n" #. CONSTANT_NAMES['DEFAULT_GROUP_NAME'] @@ -165,7 +166,7 @@ msgstr "verkkovirhe" #: searx/webapp.py:169 msgid "SSL error: certificate validation has failed" -msgstr "" +msgstr "SSL-virhe: sertifikaatin vahvistus epäonnistui" #: searx/webapp.py:171 msgid "unexpected crash" @@ -273,6 +274,8 @@ msgid "" "{numCitations} citations from the year {firstCitationVelocityYear} to " "{lastCitationVelocityYear}" msgstr "" +"{numCitations} Sitaatit vuodesta {firstCitationVelocityYear} vuoteen " +"{lastCitationVelocityYear}" #: searx/engines/tineye.py:40 msgid "" @@ -314,7 +317,7 @@ msgstr "Yö" #: searx/plugins/autodetect_search_language.py:79 msgid "Autodetect search language" -msgstr "" +msgstr "Tunnista hakukieli automaattisesti" #: searx/plugins/autodetect_search_language.py:80 msgid "Automatically detect the query search language and switch to it." @@ -455,7 +458,7 @@ msgstr "Taustavoimana" #: searx/templates/simple/base.html:64 msgid "a privacy-respecting, open metasearch engine" -msgstr "" +msgstr "yksityisyyttä kunnioittava, avoin metahakukone" #: searx/templates/simple/base.html:65 msgid "Source code" @@ -1128,11 +1131,11 @@ msgstr "piilota kartta" #: searx/templates/simple/result_templates/paper.html:5 msgid "Published date" -msgstr "" +msgstr "Julkaisupäivä" #: searx/templates/simple/result_templates/paper.html:9 msgid "Journal" -msgstr "" +msgstr "Journaali" #: searx/templates/simple/result_templates/paper.html:22 msgid "Editor" @@ -1140,7 +1143,7 @@ msgstr "" #: searx/templates/simple/result_templates/paper.html:23 msgid "Publisher" -msgstr "" +msgstr "Julkaisija" #: searx/templates/simple/result_templates/paper.html:24 msgid "Type" @@ -1148,7 +1151,7 @@ msgstr "" #: searx/templates/simple/result_templates/paper.html:25 msgid "Tags" -msgstr "" +msgstr "Tägit" #: searx/templates/simple/result_templates/paper.html:26 msgid "DOI" @@ -1156,19 +1159,19 @@ msgstr "" #: searx/templates/simple/result_templates/paper.html:27 msgid "ISSN" -msgstr "" +msgstr "ISSN" #: searx/templates/simple/result_templates/paper.html:28 msgid "ISBN" -msgstr "" +msgstr "ISBN" #: searx/templates/simple/result_templates/paper.html:33 msgid "PDF" -msgstr "" +msgstr "PDF" #: searx/templates/simple/result_templates/paper.html:34 msgid "HTML" -msgstr "" +msgstr "HTML" #: searx/templates/simple/result_templates/torrent.html:6 msgid "magnet link" @@ -1492,4 +1495,3 @@ msgstr "piilota video" #~ " <a " #~ "href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\"" #~ " rel=\"external\">Lisätietoja eri välitystavoista.</a>" - diff --git a/searx/translations/pt/LC_MESSAGES/messages.mo b/searx/translations/pt/LC_MESSAGES/messages.mo Binary files differindex a19bb34ba..72542945a 100644 --- a/searx/translations/pt/LC_MESSAGES/messages.mo +++ b/searx/translations/pt/LC_MESSAGES/messages.mo diff --git a/searx/translations/pt/LC_MESSAGES/messages.po b/searx/translations/pt/LC_MESSAGES/messages.po index 8f185ce37..933252b01 100644 --- a/searx/translations/pt/LC_MESSAGES/messages.po +++ b/searx/translations/pt/LC_MESSAGES/messages.po @@ -5,7 +5,7 @@ # Translators: # Dickprince, 2017 # C. E., 2018 -# Markus Heiser <markus.heiser@darmarit.de>, 2022. +# Markus Heiser <markus.heiser@darmarit.de>, 2022, 2023. # Miguel Silva <miguelcabeca.dev@gmail.com>, 2022. # Ricardo Simões <xmcorporation@gmail.com>, 2022. # zaioti <zaioti@tuta.io>, 2022. @@ -15,7 +15,7 @@ msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2022-12-30 07:14+0000\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" "Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" "Language-Team: Portuguese <https://weblate.bubu1.eu/projects/searxng/searxng/" "pt/>\n" @@ -40,7 +40,7 @@ msgstr "outro" #. CATEGORY_NAMES['FILES'] #: searx/searxng.msg msgid "files" -msgstr "ficheiros" +msgstr "arquivos" #. CATEGORY_NAMES['GENERAL'] #: searx/searxng.msg @@ -125,7 +125,7 @@ msgstr "repositórios" #. CATEGORY_GROUPS['SOFTWARE_WIKIS'] #: searx/searxng.msg msgid "software wikis" -msgstr "wikis de software" +msgstr "wikis do software" #. CATEGORY_GROUPS['WEB'] #: searx/searxng.msg @@ -326,6 +326,7 @@ msgstr "Deteção automatica da li" #: searx/plugins/autodetect_search_language.py:80 msgid "Automatically detect the query search language and switch to it." msgstr "" +"Detecte automaticamente o idioma de pesquisa consultado e mude para ele." #: searx/plugins/hash_plugin.py:24 msgid "Converts strings to different hash digests." diff --git a/searx/translations/sl/LC_MESSAGES/messages.mo b/searx/translations/sl/LC_MESSAGES/messages.mo Binary files differindex b5455d2b8..8a110a7c1 100644 --- a/searx/translations/sl/LC_MESSAGES/messages.mo +++ b/searx/translations/sl/LC_MESSAGES/messages.mo diff --git a/searx/translations/sl/LC_MESSAGES/messages.po b/searx/translations/sl/LC_MESSAGES/messages.po index baa398eff..a1cedb7a6 100644 --- a/searx/translations/sl/LC_MESSAGES/messages.po +++ b/searx/translations/sl/LC_MESSAGES/messages.po @@ -7,13 +7,14 @@ # Markus Heiser <markus.heiser@darmarit.de>, 2022, 2023. # Alexandre Flament <alex@al-f.net>, 2022. # peterT1D <kozlovic.peter@gmail.com>, 2022. +# Nik Drešar <nik.dresar@gmail.com>, 2023. msgid "" msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2023-01-06 07:14+0000\n" -"Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" +"Last-Translator: Nik Drešar <nik.dresar@gmail.com>\n" "Language-Team: Slovenian <https://weblate.bubu1.eu/projects/searxng/searxng/" "sl/>\n" "Language: sl\n" @@ -28,7 +29,7 @@ msgstr "" #. CONSTANT_NAMES['DEFAULT_GROUP_NAME'] #: searx/searxng.msg msgid "others" -msgstr "Drugi" +msgstr "Ostali" #. CONSTANT_NAMES['OTHER_CATEGORY'] #: searx/searxng.msg @@ -265,7 +266,7 @@ msgstr "{title} (neveljaven)" #: searx/engines/pdbe.py:103 msgid "This entry has been superseded by" -msgstr "Ta vnos je bil presezen" +msgstr "Ta vnos je bil nadomeščen z" #: searx/engines/qwant.py:219 msgid "Channel" @@ -276,6 +277,8 @@ msgid "" "{numCitations} citations from the year {firstCitationVelocityYear} to " "{lastCitationVelocityYear}" msgstr "" +"{numCitations} navedb od leta {firstCitationVelocityYear} do " +"{lastCitationVelocityYear}" #: searx/engines/tineye.py:40 msgid "" @@ -459,7 +462,7 @@ msgstr "Omogočeno z" #: searx/templates/simple/base.html:64 msgid "a privacy-respecting, open metasearch engine" -msgstr "" +msgstr "odprt metaiskalnik, ki spoštuje zasebnost" #: searx/templates/simple/base.html:65 msgid "Source code" @@ -526,37 +529,37 @@ msgstr "Če je to javna instanca, prosim specificirajte URL v poročilu o napaki #: searx/templates/simple/new_issue.html:72 msgid "Submit a new issue on Github including the above information" -msgstr "" +msgstr "Predloži novo težavo na Githubu, vključno z zgornjimi informacijami" #: searx/templates/simple/preferences.html:29 msgid "No HTTPS" -msgstr "" +msgstr "Brez HTTPS" #: searx/templates/simple/messages/no_results.html:10 #: searx/templates/simple/preferences.html:31 #: searx/templates/simple/preferences.html:32 #: searx/templates/simple/results.html:49 msgid "View error logs and submit a bug report" -msgstr "" +msgstr "Oglejte si dnevnike napak in pošljite poročilo o napakah" #: searx/templates/simple/preferences.html:53 #: searx/templates/simple/stats.html:64 msgid "Median" -msgstr "" +msgstr "Mediana" #: searx/templates/simple/preferences.html:54 #: searx/templates/simple/stats.html:70 msgid "P80" -msgstr "" +msgstr "P80" #: searx/templates/simple/preferences.html:55 #: searx/templates/simple/stats.html:76 msgid "P95" -msgstr "" +msgstr "P95" #: searx/templates/simple/preferences.html:83 msgid "Failed checker test(s): " -msgstr "" +msgstr "Neuspešno opravljen(i) preizkus(i) preverjanja: " #: searx/templates/simple/preferences.html:85 msgid "Errors:" @@ -622,7 +625,7 @@ msgstr "Filtriraj vsebino" #: searx/templates/simple/preferences.html:157 msgid "Open Access DOI resolver" -msgstr "" +msgstr "odprto dostopni DOI razreševalec" #: searx/templates/simple/preferences.html:167 msgid "" @@ -634,11 +637,11 @@ msgstr "" #: searx/templates/simple/preferences.html:171 msgid "Engine tokens" -msgstr "" +msgstr "Žetoni za iskalnik" #: searx/templates/simple/preferences.html:175 msgid "Access tokens for private engines" -msgstr "" +msgstr "Žetoni dostopa za zasebne iskalnike" #: searx/templates/simple/preferences.html:179 msgid "User interface" @@ -658,19 +661,19 @@ msgstr "Tema" #: searx/templates/simple/preferences.html:203 msgid "Change SearXNG layout" -msgstr "" +msgstr "Spremenite postavitev SearXNG" #: searx/templates/simple/preferences.html:206 msgid "Theme style" -msgstr "" +msgstr "Slog teme" #: searx/templates/simple/preferences.html:214 msgid "Choose auto to follow your browser settings" -msgstr "" +msgstr "Če želite slediti nastavitvam brskalnika, izberite samodejno" #: searx/templates/simple/preferences.html:217 msgid "Center Alignment" -msgstr "" +msgstr "Sredinska poravnava" #: searx/templates/simple/preferences.html:220 #: searx/templates/simple/preferences.html:232 @@ -686,7 +689,7 @@ msgstr "Izklopljeno" #: searx/templates/simple/preferences.html:224 msgid "Displays results in the center of the page (Oscar layout)." -msgstr "" +msgstr "Prikaže rezultate na sredini strani (postavitev Oscar)." #: searx/templates/simple/preferences.html:229 msgid "Results on new tabs" @@ -710,7 +713,7 @@ msgstr "Zasebnost" #: searx/templates/simple/preferences.html:257 msgid "HTTP Method" -msgstr "" +msgstr "metoda HTTP" #: searx/templates/simple/preferences.html:264 msgid "" @@ -718,6 +721,9 @@ msgid "" "href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\"" " rel=\"external\">learn more about request methods</a>" msgstr "" +"Spremenite način oddaje obrazcev, <a href=\"http://en.wikipedia.org/wiki/" +"Hypertext_Transfer_Protocol#Request_methods\" rel=\"external\">izvedite več " +"o metodah zahtevka</a>" #: searx/templates/simple/preferences.html:269 msgid "Image proxy" @@ -735,17 +741,19 @@ msgstr "Onemogočeno" #: searx/templates/simple/preferences.html:276 msgid "Proxying image results through SearXNG" -msgstr "" +msgstr "Proxy rezultatov slik prek SearXNG" #: searx/templates/simple/preferences.html:281 msgid "Query in the page's title" -msgstr "" +msgstr "Poizvedba v naslovu strani" #: searx/templates/simple/preferences.html:288 msgid "" "When enabled, the result page's title contains your query. Your browser " "can record this title" msgstr "" +"Ko je omogočeno, naslov strani z rezultati vsebuje vašo poizvedbo. Vaš " +"brskalnik lahko posname ta naslov" #: searx/templates/simple/preferences.html:294 msgid "Engines" @@ -760,6 +768,8 @@ msgid "" "This tab does not show up for search results, but you can search the " "engines listed here via bangs." msgstr "" +"Ta zavihek se ne prikaže pri rezultatih iskanja, lahko pa iščete iskalnike, " +"navedene tukaj, prek bangs." #: searx/templates/simple/preferences.html:307 #: searx/templates/simple/preferences.html:358 @@ -800,7 +810,7 @@ msgstr "Zanesljivost" #: searx/templates/simple/preferences.html:353 msgid "Special Queries" -msgstr "" +msgstr "Posebne poizvedbe" #: searx/templates/simple/preferences.html:359 msgid "Keywords" @@ -820,11 +830,11 @@ msgstr "Primeri" #: searx/templates/simple/preferences.html:365 msgid "This is the list of SearXNG's instant answering modules." -msgstr "" +msgstr "To je seznam modulov za takojšnje javljanje SearXNG." #: searx/templates/simple/preferences.html:376 msgid "This is the list of plugins." -msgstr "To je seznam vtičnikov" +msgstr "To je seznam vtičnikov." #: searx/templates/simple/preferences.html:393 msgid "Cookies" @@ -835,10 +845,12 @@ msgid "" "This is the list of cookies and their values SearXNG is storing on your " "computer." msgstr "" +"To je seznam piškotkov in njihovih vrednosti, ki jih SearXNG shranjuje v vaš " +"računalnik." #: searx/templates/simple/preferences.html:396 msgid "With that list, you can assess SearXNG transparency." -msgstr "" +msgstr "S tem seznamom lahko ocenite transparentnost SearXNG." #: searx/templates/simple/preferences.html:401 msgid "Cookie name" @@ -862,13 +874,15 @@ msgstr "" #: searx/templates/simple/preferences.html:419 msgid "URL to restore your preferences in another browser" -msgstr "" +msgstr "URL za obnovitev vaših nastavitev v drugem brskalniku" #: searx/templates/simple/preferences.html:423 msgid "" "Specifying custom settings in the preferences URL can be used to sync " "preferences across devices." msgstr "" +"Določanje nastavitev po meri v URL-ju z nastavitvami se lahko uporabi za " +"sinhronizacijo nastavitev med napravami." #: searx/templates/simple/preferences.html:428 msgid "" @@ -931,7 +945,7 @@ msgstr "Poskusite iskati:" #: searx/templates/simple/results.html:152 msgid "Back to top" -msgstr "" +msgstr "Nazaj na vrh" #: searx/templates/simple/results.html:170 msgid "Previous page" @@ -943,7 +957,7 @@ msgstr "Naslednja stran" #: searx/templates/simple/search.html:3 msgid "Display the front page" -msgstr "" +msgstr "Prikaži naslovno stran" #: searx/templates/simple/search.html:9 #: searx/templates/simple/simple_search.html:5 @@ -953,7 +967,7 @@ msgstr "Poišči..." #: searx/templates/simple/search.html:10 #: searx/templates/simple/simple_search.html:6 msgid "clear" -msgstr "" +msgstr "počisti" #: searx/templates/simple/search.html:11 #: searx/templates/simple/simple_search.html:7 @@ -970,19 +984,19 @@ msgstr "Točke" #: searx/templates/simple/stats.html:27 msgid "Result count" -msgstr "" +msgstr "Število rezultatov" #: searx/templates/simple/stats.html:59 msgid "Total" -msgstr "" +msgstr "Skupaj" #: searx/templates/simple/stats.html:60 msgid "HTTP" -msgstr "" +msgstr "HTTP" #: searx/templates/simple/stats.html:61 msgid "Processing" -msgstr "" +msgstr "obdelava" #: searx/templates/simple/stats.html:99 msgid "Warnings" @@ -1006,7 +1020,7 @@ msgstr "Odstotek" #: searx/templates/simple/stats.html:111 msgid "Parameter" -msgstr "" +msgstr "Parameter" #: searx/templates/simple/stats.html:119 msgid "Filename" @@ -1018,15 +1032,15 @@ msgstr "Funkcija" #: searx/templates/simple/stats.html:121 msgid "Code" -msgstr "" +msgstr "Koda" #: searx/templates/simple/stats.html:128 msgid "Checker" -msgstr "" +msgstr "Pregledovalnik" #: searx/templates/simple/stats.html:131 msgid "Failed test" -msgstr "" +msgstr "Neuspešen preizkus" #: searx/templates/simple/stats.html:132 msgid "Comment(s)" @@ -1095,7 +1109,7 @@ msgstr "Ta stran ni posredovala nobenega opisa." #: searx/templates/simple/result_templates/images.html:19 msgid "Format" -msgstr "" +msgstr "Format" #: searx/templates/simple/result_templates/images.html:21 msgid "Engine" @@ -1127,19 +1141,19 @@ msgstr "Revija" #: searx/templates/simple/result_templates/paper.html:22 msgid "Editor" -msgstr "" +msgstr "Urejevalnik" #: searx/templates/simple/result_templates/paper.html:23 msgid "Publisher" -msgstr "" +msgstr "Založnik" #: searx/templates/simple/result_templates/paper.html:24 msgid "Type" -msgstr "" +msgstr "Vrsta" #: searx/templates/simple/result_templates/paper.html:25 msgid "Tags" -msgstr "" +msgstr "Oznake" #: searx/templates/simple/result_templates/paper.html:26 msgid "DOI" diff --git a/searx/translations/uk/LC_MESSAGES/messages.mo b/searx/translations/uk/LC_MESSAGES/messages.mo Binary files differindex 4fed092ff..ba42250c6 100644 --- a/searx/translations/uk/LC_MESSAGES/messages.mo +++ b/searx/translations/uk/LC_MESSAGES/messages.mo diff --git a/searx/translations/uk/LC_MESSAGES/messages.po b/searx/translations/uk/LC_MESSAGES/messages.po index e69aaacf1..15322ecda 100644 --- a/searx/translations/uk/LC_MESSAGES/messages.po +++ b/searx/translations/uk/LC_MESSAGES/messages.po @@ -6,24 +6,25 @@ # pvhn4 <pvhn4@protonmail.com>, 2017 # zubr139, 2016-2017 # Andrij Mizyk <andmizyk@gmail.com>, 2022. -# Markus Heiser <markus.heiser@darmarit.de>, 2022. +# Markus Heiser <markus.heiser@darmarit.de>, 2022, 2023. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2022-12-12 07:18+0000\n" -"PO-Revision-Date: 2022-11-25 07:16+0000\n" +"PO-Revision-Date: 2023-01-13 07:14+0000\n" "Last-Translator: Markus Heiser <markus.heiser@darmarit.de>\n" +"Language-Team: Ukrainian <https://weblate.bubu1.eu/projects/searxng/searxng/" +"uk/>\n" "Language: uk\n" -"Language-Team: Ukrainian " -"<https://weblate.bubu1.eu/projects/searxng/searxng/uk/>\n" -"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 !=" -" 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n " -"% 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9)" -" || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 " +"? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > " +"14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % " +"100 >=11 && n % 100 <=14 )) ? 2: 3);\n" +"X-Generator: Weblate 4.14.1\n" "Generated-By: Babel 2.11.0\n" #. CONSTANT_NAMES['DEFAULT_GROUP_NAME'] @@ -277,6 +278,8 @@ msgid "" "{numCitations} citations from the year {firstCitationVelocityYear} to " "{lastCitationVelocityYear}" msgstr "" +"{numCitations} цитувань з {firstCitationVelocityYear} по " +"{lastCitationVelocityYear} рік" #: searx/engines/tineye.py:40 msgid "" @@ -284,6 +287,9 @@ msgid "" "format. TinEye only supports images that are JPEG, PNG, GIF, BMP, TIFF or" " WebP." msgstr "" +"Не вдалось зчитати зображення за вказаним URL. Можливо, тому що формат " +"даного зображення не підтримується. TinEye підтримує зображення у форматах " +"JPEG, PNG, GIF, BMP, TIFF та WebP." #: searx/engines/tineye.py:46 msgid "" @@ -299,7 +305,7 @@ msgstr "Зображення не можливо завантажити." #: searx/engines/wttr.py:101 msgid "Morning" -msgstr "" +msgstr "Ранок" #: searx/engines/wttr.py:101 msgid "Noon" @@ -1472,4 +1478,3 @@ msgstr "приховати відео" #~ "href=\"http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods\"" #~ " rel=\"external\">детальніше про методи " #~ "запитів</a>" - diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py new file mode 100644 index 000000000..13d004322 --- /dev/null +++ b/tests/unit/test_exceptions.py @@ -0,0 +1,41 @@ +# SPDX-License-Identifier: AGPL-3.0-or-later + +from tests import SearxTestCase +import searx.exceptions +from searx import get_setting + + +class TestExceptions(SearxTestCase): + def test_default_suspend_time(self): + with self.assertRaises(searx.exceptions.SearxEngineAccessDeniedException) as e: + raise searx.exceptions.SearxEngineAccessDeniedException() + self.assertEqual( + e.exception.suspended_time, + get_setting(searx.exceptions.SearxEngineAccessDeniedException.SUSPEND_TIME_SETTING), + ) + + with self.assertRaises(searx.exceptions.SearxEngineCaptchaException) as e: + raise searx.exceptions.SearxEngineCaptchaException() + self.assertEqual( + e.exception.suspended_time, get_setting(searx.exceptions.SearxEngineCaptchaException.SUSPEND_TIME_SETTING) + ) + + with self.assertRaises(searx.exceptions.SearxEngineTooManyRequestsException) as e: + raise searx.exceptions.SearxEngineTooManyRequestsException() + self.assertEqual( + e.exception.suspended_time, + get_setting(searx.exceptions.SearxEngineTooManyRequestsException.SUSPEND_TIME_SETTING), + ) + + def test_custom_suspend_time(self): + with self.assertRaises(searx.exceptions.SearxEngineAccessDeniedException) as e: + raise searx.exceptions.SearxEngineAccessDeniedException(suspended_time=1337) + self.assertEqual(e.exception.suspended_time, 1337) + + with self.assertRaises(searx.exceptions.SearxEngineCaptchaException) as e: + raise searx.exceptions.SearxEngineCaptchaException(suspended_time=1409) + self.assertEqual(e.exception.suspended_time, 1409) + + with self.assertRaises(searx.exceptions.SearxEngineTooManyRequestsException) as e: + raise searx.exceptions.SearxEngineTooManyRequestsException(suspended_time=1543) + self.assertEqual(e.exception.suspended_time, 1543) |