diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 9c8eaf059c6..1605f28bb12 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,14 +38,6 @@ jobs: make V=1 gecko.driver - name: Run tests run: make V=1 ci.test - - name: Test coverage - run: make V=1 test.coverage - - name: Store coverage result - uses: actions/upload-artifact@v3 - with: - name: coverage-${{ matrix.python-version }} - path: coverage/ - retention-days: 60 themes: name: Themes diff --git a/searx/engines/annas_archive.py b/searx/engines/annas_archive.py index bc74b3c86ee..ea1ab42a41c 100644 --- a/searx/engines/annas_archive.py +++ b/searx/engines/annas_archive.py @@ -34,10 +34,10 @@ """ from typing import List, Dict, Any, Optional -from urllib.parse import quote +from urllib.parse import urlencode from lxml import html -from searx.utils import extract_text, eval_xpath, eval_xpath_list +from searx.utils import extract_text, eval_xpath, eval_xpath_getindex, eval_xpath_list from searx.enginelib.traits import EngineTraits from searx.data import ENGINE_TRAITS @@ -53,7 +53,7 @@ # engine dependent config categories: List[str] = ["files"] -paging: bool = False +paging: bool = True # search-url base_url: str = "https://annas-archive.org" @@ -99,9 +99,18 @@ def init(engine_settings=None): # pylint: disable=unused-argument def request(query, params: Dict[str, Any]) -> Dict[str, Any]: - q = quote(query) lang = traits.get_language(params["language"], traits.all_locale) # type: ignore - params["url"] = base_url + f"/search?lang={lang or ''}&content={aa_content}&ext={aa_ext}&sort={aa_sort}&q={q}" + args = { + 'lang': lang, + 'content': aa_content, + 'ext': aa_ext, + 'sort': aa_sort, + 'q': query, + 'page': params['pageno'], + } + # filter out None and empty values + filtered_args = dict((k, v) for k, v in args.items() if v) + params["url"] = f"{base_url}/search?{urlencode(filtered_args)}" return params @@ -128,12 +137,12 @@ def response(resp) -> List[Dict[str, Optional[str]]]: def _get_result(item): return { 'template': 'paper.html', - 'url': base_url + item.xpath('./@href')[0], + 'url': base_url + extract_text(eval_xpath_getindex(item, './@href', 0)), 'title': extract_text(eval_xpath(item, './/h3/text()[1]')), 'publisher': extract_text(eval_xpath(item, './/div[contains(@class, "text-sm")]')), 'authors': [extract_text(eval_xpath(item, './/div[contains(@class, "italic")]'))], 'content': extract_text(eval_xpath(item, './/div[contains(@class, "text-xs")]')), - 'thumbnail': item.xpath('.//img/@src')[0], + 'thumbnail': extract_text(eval_xpath_getindex(item, './/img/@src', 0, default=None), allow_none=True), } diff --git a/searx/translations/es/LC_MESSAGES/messages.mo b/searx/translations/es/LC_MESSAGES/messages.mo index c0281799207..574fb79809b 100644 Binary files a/searx/translations/es/LC_MESSAGES/messages.mo and b/searx/translations/es/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/es/LC_MESSAGES/messages.po b/searx/translations/es/LC_MESSAGES/messages.po index d83710388bf..2ae51c74b71 100644 --- a/searx/translations/es/LC_MESSAGES/messages.po +++ b/searx/translations/es/LC_MESSAGES/messages.po @@ -39,7 +39,7 @@ msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-10-06 14:31+0000\n" +"PO-Revision-Date: 2024-10-26 21:13+0000\n" "Last-Translator: Atul_Eterno \n" "Language-Team: Spanish , 2024. # notlmutsaers , 2024. # return42 , 2024. +# ljansen , 2024. msgid "" msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-10-15 12:18+0000\n" -"Last-Translator: return42 \n" +"PO-Revision-Date: 2024-10-28 21:07+0000\n" +"Last-Translator: ljansen \n" "Language-Team: Dutch \n" "Language: nl\n" @@ -36,7 +37,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.7.2\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -464,7 +465,7 @@ msgstr "Bereken {functions} van de opties" #: searx/engines/mozhi.py:57 msgid "Synonyms" -msgstr "" +msgstr "Synoniemen" #: searx/engines/openstreetmap.py:159 msgid "Get directions" @@ -1234,12 +1235,13 @@ msgid "Max time" msgstr "Max. duur" #: searx/templates/simple/preferences/favicon.html:2 +#, fuzzy msgid "Favicon Resolver" -msgstr "" +msgstr "favicon-resolver" #: searx/templates/simple/preferences/favicon.html:15 msgid "Display favicons near search results" -msgstr "" +msgstr "Vertoon zoekresultaten naast favicons" #: searx/templates/simple/preferences/footer.html:2 msgid "" diff --git a/searx/translations/pl/LC_MESSAGES/messages.mo b/searx/translations/pl/LC_MESSAGES/messages.mo index b1efe7ddcf9..df0d888dbea 100644 Binary files a/searx/translations/pl/LC_MESSAGES/messages.mo and b/searx/translations/pl/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/pl/LC_MESSAGES/messages.po b/searx/translations/pl/LC_MESSAGES/messages.po index 88db5fded9e..ba040ff47b0 100644 --- a/searx/translations/pl/LC_MESSAGES/messages.po +++ b/searx/translations/pl/LC_MESSAGES/messages.po @@ -23,8 +23,8 @@ msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-10-15 12:18+0000\n" -"Last-Translator: return42 \n" +"PO-Revision-Date: 2024-10-28 21:07+0000\n" +"Last-Translator: Eryk Michalak \n" "Language-Team: Polish \n" "Language: pl\n" @@ -34,7 +34,7 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (" "n%100<12 || n%100>14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && " "n%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" -"X-Generator: Weblate 5.7.2\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -1230,7 +1230,7 @@ msgstr "Maksymalny czas" #: searx/templates/simple/preferences/favicon.html:2 msgid "Favicon Resolver" -msgstr "" +msgstr "Pobieranie favikony" #: searx/templates/simple/preferences/favicon.html:15 msgid "Display favicons near search results" diff --git a/searx/translations/pt/LC_MESSAGES/messages.mo b/searx/translations/pt/LC_MESSAGES/messages.mo index 0bc2c6f53d1..46fef4d731a 100644 Binary files a/searx/translations/pt/LC_MESSAGES/messages.mo and b/searx/translations/pt/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/pt/LC_MESSAGES/messages.po b/searx/translations/pt/LC_MESSAGES/messages.po index dec3a0e7228..c694279bb0f 100644 --- a/searx/translations/pt/LC_MESSAGES/messages.po +++ b/searx/translations/pt/LC_MESSAGES/messages.po @@ -19,13 +19,14 @@ # gvlx , 2024. # ds451 , 2024. # Pedro_Tresp , 2024. +# saltsnorter , 2024. msgid "" msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-10-13 23:26+0000\n" -"Last-Translator: Pedro_Tresp \n" "Language-Team: Portuguese \n" @@ -34,7 +35,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Weblate 5.7.2\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -175,7 +176,7 @@ msgstr "escuro" #. STYLE_NAMES['BLACK'] #: searx/searxng.msg msgid "black" -msgstr "" +msgstr "preto" #. BRAND_CUSTOM_LINKS['UPTIME'] #: searx/searxng.msg @@ -1228,11 +1229,11 @@ msgstr "Tempo máximo" #: searx/templates/simple/preferences/favicon.html:2 msgid "Favicon Resolver" -msgstr "" +msgstr "Solucionador do Favicon" #: searx/templates/simple/preferences/favicon.html:15 msgid "Display favicons near search results" -msgstr "" +msgstr "Monstra os favicons nos proximos os resultados" #: searx/templates/simple/preferences/footer.html:2 msgid "" diff --git a/searx/translations/pt_BR/LC_MESSAGES/messages.mo b/searx/translations/pt_BR/LC_MESSAGES/messages.mo index fd0364c1040..29ac2128add 100644 Binary files a/searx/translations/pt_BR/LC_MESSAGES/messages.mo and b/searx/translations/pt_BR/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/pt_BR/LC_MESSAGES/messages.po b/searx/translations/pt_BR/LC_MESSAGES/messages.po index e8cd9786819..87bc01fa6f6 100644 --- a/searx/translations/pt_BR/LC_MESSAGES/messages.po +++ b/searx/translations/pt_BR/LC_MESSAGES/messages.po @@ -30,13 +30,14 @@ # Pyrbor , 2024. # rodgui , 2024. # rafablog77 , 2024. +# Juno Takano , 2024. msgid "" msgstr "" "Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-10-15 12:18+0000\n" -"Last-Translator: return42 \n" +"PO-Revision-Date: 2024-10-31 12:16+0000\n" +"Last-Translator: Juno Takano \n" "Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" @@ -44,7 +45,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.7.2\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -185,7 +186,7 @@ msgstr "escuro" #. STYLE_NAMES['BLACK'] #: searx/searxng.msg msgid "black" -msgstr "" +msgstr "preto" #. BRAND_CUSTOM_LINKS['UPTIME'] #: searx/searxng.msg @@ -472,7 +473,7 @@ msgstr "Computar {functions} dos argumentos" #: searx/engines/mozhi.py:57 msgid "Synonyms" -msgstr "" +msgstr "Sinônimos" #: searx/engines/openstreetmap.py:159 msgid "Get directions" @@ -1243,7 +1244,7 @@ msgstr "Tempo máximo" #: searx/templates/simple/preferences/favicon.html:2 msgid "Favicon Resolver" -msgstr "" +msgstr "Resolvedor de Favicons" #: searx/templates/simple/preferences/favicon.html:15 msgid "Display favicons near search results" diff --git a/searx/translations/vi/LC_MESSAGES/messages.mo b/searx/translations/vi/LC_MESSAGES/messages.mo index e6738d925f2..90d16217ec0 100644 Binary files a/searx/translations/vi/LC_MESSAGES/messages.mo and b/searx/translations/vi/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/vi/LC_MESSAGES/messages.po b/searx/translations/vi/LC_MESSAGES/messages.po index d02b3e9e2cf..4f3f28d006c 100644 --- a/searx/translations/vi/LC_MESSAGES/messages.po +++ b/searx/translations/vi/LC_MESSAGES/messages.po @@ -12,19 +12,19 @@ # tvminh19 , 2024. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-08-07 01:02+0000\n" -"Last-Translator: tvminh19 " -"\n" +"PO-Revision-Date: 2024-10-26 21:13+0000\n" +"Last-Translator: return42 \n" +"Language-Team: Vietnamese \n" "Language: vi\n" -"Language-Team: Vietnamese " -"\n" -"Plural-Forms: nplurals=1; plural=0;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -186,7 +186,7 @@ msgstr "Nhiệt độ trung bình." #. WEATHER_TERMS['CLOUD COVER'] #: searx/engines/open_meteo.py:91 searx/searxng.msg msgid "Cloud cover" -msgstr "" +msgstr "Mây che phủ" #. WEATHER_TERMS['CONDITION'] #: searx/engines/duckduckgo_weather.py:45 searx/engines/wttr.py:51 @@ -283,7 +283,7 @@ msgstr "" #: searx/engines/duckduckgo_weather.py:58 searx/engines/open_meteo.py:86 #: searx/engines/wttr.py:62 searx/searxng.msg msgid "Wind" -msgstr "" +msgstr "Gió" #. SOCIAL_MEDIA_TERMS['SUBSCRIBERS'] #: searx/engines/lemmy.py:85 searx/searxng.msg @@ -1990,4 +1990,3 @@ msgstr "ẩn phim" #~ msgid "Engines cannot retrieve results" #~ msgstr "Các trình tìm kiếm không nhận được kết quả" - diff --git a/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.mo b/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.mo index 412f48e852f..fc8422910fc 100644 Binary files a/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.mo and b/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.mo differ diff --git a/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.po b/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.po index cd751b01150..7e4b8e3ae5b 100644 --- a/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.po +++ b/searx/translations/zh_Hant_TW/LC_MESSAGES/messages.po @@ -28,18 +28,19 @@ # hugoalh , 2024. msgid "" msgstr "" -"Project-Id-Version: searx\n" +"Project-Id-Version: searx\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2024-10-05 06:24+0000\n" -"PO-Revision-Date: 2024-08-12 04:00+0000\n" -"Last-Translator: hugoalh \n" +"PO-Revision-Date: 2024-10-26 21:13+0000\n" +"Last-Translator: return42 \n" +"Language-Team: Chinese (Traditional Han script) \n" "Language: zh_Hant_TW\n" -"Language-Team: Chinese (Traditional) " -"\n" -"Plural-Forms: nplurals=1; plural=0;\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.8.1\n" "Generated-By: Babel 2.16.0\n" #. CONSTANT_NAMES['NO_SUBGROUPING'] @@ -180,7 +181,7 @@ msgstr "黑暗" #. STYLE_NAMES['BLACK'] #: searx/searxng.msg msgid "black" -msgstr "" +msgstr "黑色" #. BRAND_CUSTOM_LINKS['UPTIME'] #: searx/searxng.msg @@ -467,7 +468,7 @@ msgstr "計算 {functions} 參數" #: searx/engines/mozhi.py:57 msgid "Synonyms" -msgstr "" +msgstr "同義詞" #: searx/engines/openstreetmap.py:159 msgid "Get directions" @@ -942,7 +943,7 @@ msgstr "來自搜尋引擎的訊息" #: searx/templates/simple/elements/engines_msg.html:7 msgid "seconds" -msgstr "" +msgstr "秒" #: searx/templates/simple/elements/search_url.html:3 msgid "Search URL" @@ -1206,11 +1207,11 @@ msgstr "最大時間" #: searx/templates/simple/preferences/favicon.html:2 msgid "Favicon Resolver" -msgstr "" +msgstr "網站圖標搜索器" #: searx/templates/simple/preferences/favicon.html:15 msgid "Display favicons near search results" -msgstr "" +msgstr "在搜尋結果旁顯示網站圖標" #: searx/templates/simple/preferences/footer.html:2 msgid "" @@ -1911,4 +1912,3 @@ msgstr "隱藏影片" #~ msgid "Engines cannot retrieve results" #~ msgstr "引擎無法擷取結果" -