Skip to content

Commit

Permalink
Merge branch 'searxng:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Aadniz authored Nov 2, 2024
2 parents 6f75737 + b07c0ae commit d85c363
Show file tree
Hide file tree
Showing 16 changed files with 66 additions and 62 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 16 additions & 7 deletions searx/engines/annas_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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"
Expand Down Expand Up @@ -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


Expand All @@ -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),
}


Expand Down
Binary file modified searx/translations/es/LC_MESSAGES/messages.mo
Binary file not shown.
6 changes: 3 additions & 3 deletions searx/translations/es/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]."
"org>\n"
"Language-Team: Spanish <https://translate.codeberg.org/projects/searxng/"
Expand All @@ -49,7 +49,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']
Expand Down Expand Up @@ -155,7 +155,7 @@ msgstr "preguntas y respuestas"
#. CATEGORY_GROUPS['REPOS']
#: searx/searxng.msg
msgid "repos"
msgstr "repos"
msgstr "repositorios"

#. CATEGORY_GROUPS['SOFTWARE_WIKIS']
#: searx/searxng.msg
Expand Down
Binary file modified searx/translations/nl/LC_MESSAGES/messages.mo
Binary file not shown.
14 changes: 8 additions & 6 deletions searx/translations/nl/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,22 @@
# MVDW-Java <[email protected]>, 2024.
# notlmutsaers <[email protected]>, 2024.
# return42 <[email protected]>, 2024.
# ljansen <[email protected]>, 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 <return42@users.noreply.translate.codeberg.org>\n"
"PO-Revision-Date: 2024-10-28 21:07+0000\n"
"Last-Translator: ljansen <ljansen@users.noreply.translate.codeberg.org>\n"
"Language-Team: Dutch <https://translate.codeberg.org/projects/searxng/"
"searxng/nl/>\n"
"Language: nl\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 5.7.2\n"
"X-Generator: Weblate 5.8.1\n"
"Generated-By: Babel 2.16.0\n"

#. CONSTANT_NAMES['NO_SUBGROUPING']
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""
Expand Down
Binary file modified searx/translations/pl/LC_MESSAGES/messages.mo
Binary file not shown.
8 changes: 4 additions & 4 deletions searx/translations/pl/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>\n"
"PO-Revision-Date: 2024-10-28 21:07+0000\n"
"Last-Translator: Eryk Michalak <[email protected]>\n"
"Language-Team: Polish <https://translate.codeberg.org/projects/searxng/"
"searxng/pl/>\n"
"Language: pl\n"
Expand All @@ -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']
Expand Down Expand Up @@ -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"
Expand Down
Binary file modified searx/translations/pt/LC_MESSAGES/messages.mo
Binary file not shown.
13 changes: 7 additions & 6 deletions searx/translations/pt/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
# gvlx <[email protected]>, 2024.
# ds451 <[email protected]>, 2024.
# Pedro_Tresp <[email protected]>, 2024.
# saltsnorter <[email protected]>, 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 <Pedro_Tresp@users.noreply.translate.codeberg."
"PO-Revision-Date: 2024-10-29 05:54+0000\n"
"Last-Translator: saltsnorter <saltsnorter@users.noreply.translate.codeberg."
"org>\n"
"Language-Team: Portuguese <https://translate.codeberg.org/projects/searxng/"
"searxng/pt/>\n"
Expand All @@ -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']
Expand Down Expand Up @@ -175,7 +176,7 @@ msgstr "escuro"
#. STYLE_NAMES['BLACK']
#: searx/searxng.msg
msgid "black"
msgstr ""
msgstr "preto"

#. BRAND_CUSTOM_LINKS['UPTIME']
#: searx/searxng.msg
Expand Down Expand Up @@ -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 ""
Expand Down
Binary file modified searx/translations/pt_BR/LC_MESSAGES/messages.mo
Binary file not shown.
13 changes: 7 additions & 6 deletions searx/translations/pt_BR/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,22 @@
# Pyrbor <[email protected]>, 2024.
# rodgui <[email protected]>, 2024.
# rafablog77 <[email protected]>, 2024.
# Juno Takano <[email protected]>, 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 <return42@users.noreply.translate.codeberg.org>\n"
"PO-Revision-Date: 2024-10-31 12:16+0000\n"
"Last-Translator: Juno Takano <jutty@users.noreply.translate.codeberg.org>\n"
"Language-Team: Portuguese (Brazil) <https://translate.codeberg.org/projects/"
"searxng/searxng/pt_BR/>\n"
"Language: pt_BR\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 5.7.2\n"
"X-Generator: Weblate 5.8.1\n"
"Generated-By: Babel 2.16.0\n"

#. CONSTANT_NAMES['NO_SUBGROUPING']
Expand Down Expand Up @@ -185,7 +186,7 @@ msgstr "escuro"
#. STYLE_NAMES['BLACK']
#: searx/searxng.msg
msgid "black"
msgstr ""
msgstr "preto"

#. BRAND_CUSTOM_LINKS['UPTIME']
#: searx/searxng.msg
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
Binary file modified searx/translations/vi/LC_MESSAGES/messages.mo
Binary file not shown.
19 changes: 9 additions & 10 deletions searx/translations/vi/LC_MESSAGES/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
# tvminh19 <[email protected]>, 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 <[email protected]>"
"\n"
"PO-Revision-Date: 2024-10-26 21:13+0000\n"
"Last-Translator: return42 <[email protected]>\n"
"Language-Team: Vietnamese <https://translate.codeberg.org/projects/searxng/"
"searxng/vi/>\n"
"Language: vi\n"
"Language-Team: Vietnamese "
"<https://translate.codeberg.org/projects/searxng/searxng/vi/>\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']
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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ả"

Binary file modified searx/translations/zh_Hant_TW/LC_MESSAGES/messages.mo
Binary file not shown.
Loading

0 comments on commit d85c363

Please sign in to comment.