diff --git a/docs/admin/api.rst b/docs/admin/api.rst index 8f4552f9c..8bd563ba7 100644 --- a/docs/admin/api.rst +++ b/docs/admin/api.rst @@ -84,9 +84,9 @@ HTML of the site. URL of the SearXNG instance and values are customizable. .. code:: html
diff --git a/docs/dev/engines/online/gitlab.rst b/docs/dev/engines/online/gitlab.rst new file mode 100644 index 000000000..5f0d3e3d1 --- /dev/null +++ b/docs/dev/engines/online/gitlab.rst @@ -0,0 +1,8 @@ +.. _gitlab engine: + +====== +GitLab +====== + +.. automodule:: searx.engines.gitlab + :members: diff --git a/searx/botdetection/link_token.py b/searx/botdetection/link_token.py index 7a484d6d5..8f8e9839c 100644 --- a/searx/botdetection/link_token.py +++ b/searx/botdetection/link_token.py @@ -28,7 +28,7 @@ And in the HTML template from flask a stylesheet link is needed (the value of + type="text/css" > .. _X-Forwarded-For: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For diff --git a/searx/data/engine_traits.json b/searx/data/engine_traits.json index c103d43a3..e9bc47ade 100644 --- a/searx/data/engine_traits.json +++ b/searx/data/engine_traits.json @@ -3,40 +3,40 @@ "all_locale": "", "custom": { "content": [ - "book_nonfiction", + "book_comic", "book_fiction", + "book_nonfiction", "book_unknown", "magazine", - "book_comic", - "standards_document", - "musical_score" + "musical_score", + "other", + "standards_document" ], "ext": [ - "pdf", + "azw3", + "cbr", + "cbz", + "djvu", "epub", "fb2", "mobi", - "cbr", - "djvu", - "txt", - "cbz", - "azw3" + "pdf", + "txt" ], "sort": [ "", - "newest", - "oldest", "largest", - "smallest", + "newest", "newest_added", - "oldest_added" + "oldest", + "oldest_added", + "smallest" ] }, "data_type": "traits_v1", "languages": { "af": "af", "ar": "ar", - "az": "az", "be": "be", "bg": "bg", "bn": "bn", @@ -86,11 +86,14 @@ "ro": "ro", "ru": "ru", "rw": "rw", + "sa": "sa", + "se": "se", "sk": "sk", "sl": "sl", "sr": "sr", "sv": "sv", "ta": "ta", + "th": "th", "tr": "tr", "uk": "uk", "ur": "ur", @@ -119,6 +122,7 @@ "ar": "\u0627\u0644\u0639\u0631\u0628\u064a\u0629", "bg": "\u0411\u044a\u043b\u0433\u0430\u0440\u0441\u043a\u0438", "bs": "Bosanski", + "ca": "Catal\u00e0", "cs": "\u010ce\u0161tina", "da": "Dansk", "de": "Deutsch", @@ -1764,8 +1768,10 @@ "id": "id", "it": "it", "ja-JP": "ja-jp", + "ko": "ko", "lt": "lt", "lv": "lv", + "ms": "ms", "nb": "nb", "nl": "nl", "pl": "pl", @@ -1775,10 +1781,15 @@ "sk": "sk", "sl": "sl", "sq-AL": "sq-al", + "sr_Cyrl": "sr-cyrl", + "sr_Latn": "sr-latn", "sv": "sv", "sw-KE": "sw-ke", + "th": "th", "tr": "tr", "uk": "uk", + "vi": "vi", + "zh_Hans": "zh-hans", "zh_Hant": "zh-hant" } }, @@ -1858,8 +1869,10 @@ "id": "id", "it": "it", "ja-JP": "ja-jp", + "ko": "ko", "lt": "lt", "lv": "lv", + "ms": "ms", "nb": "nb", "nl": "nl", "pl": "pl", @@ -1869,10 +1882,15 @@ "sk": "sk", "sl": "sl", "sq-AL": "sq-al", + "sr_Cyrl": "sr-cyrl", + "sr_Latn": "sr-latn", "sv": "sv", "sw-KE": "sw-ke", + "th": "th", "tr": "tr", "uk": "uk", + "vi": "vi", + "zh_Hans": "zh-hans", "zh_Hant": "zh-hant" } }, @@ -1952,8 +1970,10 @@ "id": "id", "it": "it", "ja-JP": "ja-jp", + "ko": "ko", "lt": "lt", "lv": "lv", + "ms": "ms", "nb": "nb", "nl": "nl", "pl": "pl", @@ -1963,10 +1983,15 @@ "sk": "sk", "sl": "sl", "sq-AL": "sq-al", + "sr_Cyrl": "sr-cyrl", + "sr_Latn": "sr-latn", "sv": "sv", "sw-KE": "sw-ke", + "th": "th", "tr": "tr", "uk": "uk", + "vi": "vi", + "zh_Hans": "zh-hans", "zh_Hant": "zh-hant" } }, @@ -2046,8 +2071,10 @@ "id": "id", "it": "it", "ja-JP": "ja-jp", + "ko": "ko", "lt": "lt", "lv": "lv", + "ms": "ms", "nb": "nb", "nl": "nl", "pl": "pl", @@ -2057,10 +2084,15 @@ "sk": "sk", "sl": "sl", "sq-AL": "sq-al", + "sr_Cyrl": "sr-cyrl", + "sr_Latn": "sr-latn", "sv": "sv", "sw-KE": "sw-ke", + "th": "th", "tr": "tr", "uk": "uk", + "vi": "vi", + "zh_Hans": "zh-hans", "zh_Hant": "zh-hant" } }, @@ -6151,7 +6183,6 @@ "BY", "BZ", "CA", - "CC", "CD", "CF", "CG", @@ -6249,6 +6280,7 @@ "MN", "MO", "MQ", + "MS", "MT", "MU", "MW", @@ -6403,7 +6435,6 @@ "la": "latin", "lb": "luxembourgish", "ln": "lingala", - "lo": "lao", "lt": "lithuanian", "lv": "latvian", "mg": "malagasy", @@ -6436,6 +6467,7 @@ "si": "sinhala", "sk": "slovak", "sl": "slovenian", + "sn": "shona", "so": "somali", "sq": "albanian", "sr": "serbian", @@ -6784,6 +6816,7 @@ "bat-smg", "bbc", "bcl", + "bdr", "be", "be-tarask", "bew", diff --git a/searx/engines/annas_archive.py b/searx/engines/annas_archive.py index a290dd06e..bc74b3c86 100644 --- a/searx/engines/annas_archive.py +++ b/searx/engines/annas_archive.py @@ -184,3 +184,8 @@ def fetch_traits(engine_traits: EngineTraits): for x in eval_xpath_list(dom, "//form//select[@name='sort']//option"): engine_traits.custom['sort'].append(x.get("value")) + + # for better diff; sort the persistence of these traits + engine_traits.custom['content'].sort() + engine_traits.custom['ext'].sort() + engine_traits.custom['sort'].sort() diff --git a/searx/engines/brave.py b/searx/engines/brave.py index 4c43386ed..6f7e342e7 100644 --- a/searx/engines/brave.py +++ b/searx/engines/brave.py @@ -430,7 +430,8 @@ def fetch_traits(engine_traits: EngineTraits): ui_lang = option.get('value') try: - if '-' in ui_lang and not ui_lang.startswith("zh-"): + l = babel.Locale.parse(ui_lang, sep='-') + if l.territory: sxng_tag = region_tag(babel.Locale.parse(ui_lang, sep='-')) else: sxng_tag = language_tag(babel.Locale.parse(ui_lang, sep='-')) @@ -453,7 +454,7 @@ def fetch_traits(engine_traits: EngineTraits): if not resp.ok: # type: ignore print("ERROR: response from Brave is not OK.") - country_js = resp.text[resp.text.index("options:{all") + len('options:') :] + country_js = resp.text[resp.text.index("options:{all") + len('options:') :] # type: ignore country_js = country_js[: country_js.index("},k={default")] country_tags = js_variable_to_python(country_js) diff --git a/searx/engines/btdigg.py b/searx/engines/btdigg.py index 193785182..5743f4142 100644 --- a/searx/engines/btdigg.py +++ b/searx/engines/btdigg.py @@ -54,7 +54,6 @@ def response(resp): excerpt = result.xpath('.//div[@class="torrent_excerpt"]')[0] content = html.tostring(excerpt, encoding='unicode', method='text', with_tail=False) - # it is better to emit