SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] pylint all engines without PYLINT_SEARXNG_DISABLE_OPTION
Markus Heiser8205f170ff98
diff --git a/manage b/manageindex efb6c265a..9871906d2 100755--- a/manage+++ b/manage@@ -64,6 +64,11 @@ pylint.FILES() {find . -name searxng.msg}+PYLINT_FILES=()+while IFS= read -r line; do+ PYLINT_FILES+=("$line")+done <<< "$(pylint.FILES)"+YAMLLINT_FILES=()while IFS= read -r line; doYAMLLINT_FILES+=("$line")@@ -77,9 +82,6 @@ PYLINT_SEARXNG_DISABLE_OPTION="\I,C,R,\W0105,W0212,W0511,W0603,W0613,W0621,W0702,W0703,W1401,\E1136"-PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES="traits,supported_languages,language_aliases,logger,categories"-PYLINT_OPTIONS="-m pylint -j 0 --rcfile .pylintrc"-help() {nvm.helpcat <<EOF@@ -338,12 +340,6 @@ format.python() {dump_return $?}--PYLINT_FILES=()-while IFS= read -r line; do- PYLINT_FILES+=("$line")-done <<< "$(pylint.FILES)"-# shellcheck disable=SC2119main() {diff --git a/searx/engines/1337x.py b/searx/engines/1337x.pyindex 730a4c445..221297503 100644--- a/searx/engines/1337x.py+++ b/searx/engines/1337x.py@@ -1,6 +1,7 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- 1337x+# pylint: disable=invalid-name+"""1337x+"""from urllib.parse import quote, urljoindiff --git a/searx/engines/9gag.py b/searx/engines/9gag.pyindex d1846725c..962e0af64 100644--- a/searx/engines/9gag.py+++ b/searx/engines/9gag.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint# pylint: disable=invalid-name"""9GAG (social media)"""diff --git a/searx/engines/__init__.py b/searx/engines/__init__.pyindex 0bea37ca8..bcbdbe8aa 100644--- a/searx/engines/__init__.py+++ b/searx/engines/__init__.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Load and initialize the ``engines``, see :py:func:`load_engines` and register:py:obj:`engine_shortcuts`.diff --git a/searx/engines/ahmia.py b/searx/engines/ahmia.pyindex 33e0cc393..7c8bb5868 100644--- a/searx/engines/ahmia.py+++ b/searx/engines/ahmia.py@@ -74,7 +74,7 @@ def response(resp):if number_of_results:try:results.append({'number_of_results': int(extract_text(number_of_results))})- except:+ except: # pylint: disable=bare-exceptpassreturn resultsdiff --git a/searx/engines/annas_archive.py b/searx/engines/annas_archive.pyindex 37c9d66a4..d758e4a96 100644--- a/searx/engines/annas_archive.py+++ b/searx/engines/annas_archive.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""`Anna's Archive`_ is a free non-profit online shadow library metasearchengine providing access to a variety of book resources (also via IPFS), createdby a team of anonymous archivists (AnnaArchivist_).diff --git a/searx/engines/apkmirror.py b/searx/engines/apkmirror.pyindex ac7cd7431..93d093a60 100644--- a/searx/engines/apkmirror.py+++ b/searx/engines/apkmirror.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""APKMirror"""diff --git a/searx/engines/apple_app_store.py b/searx/engines/apple_app_store.pyindex f75a1a657..a11dd0f5c 100644--- a/searx/engines/apple_app_store.py+++ b/searx/engines/apple_app_store.py@@ -1,7 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint-"""- Apple App Store+"""Apple App Store+"""from json import loadsdiff --git a/searx/engines/apple_maps.py b/searx/engines/apple_maps.pyindex eb4af422e..e725e0306 100644--- a/searx/engines/apple_maps.py+++ b/searx/engines/apple_maps.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Apple Maps"""from json import loadsdiff --git a/searx/engines/archlinux.py b/searx/engines/archlinux.pyindex 9d5009ed7..820b31799 100644--- a/searx/engines/archlinux.py+++ b/searx/engines/archlinux.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Arch Linux Wiki~~~~~~~~~~~~~~~diff --git a/searx/engines/artic.py b/searx/engines/artic.pyindex 506a9cea6..5ef613546 100644--- a/searx/engines/artic.py+++ b/searx/engines/artic.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""The Art Institute of ChicagoExplore thousands of artworks from The Art Institute of Chicago.diff --git a/searx/engines/arxiv.py b/searx/engines/arxiv.pyindex a4811ebd5..39fcb1a34 100644--- a/searx/engines/arxiv.py+++ b/searx/engines/arxiv.py@@ -1,11 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- ArXiV (Scientific preprints)+"""ArXiV (Scientific preprints)+"""+from datetime import datetime+from lxml import etreefrom lxml.etree import XPath-from datetime import datetimefrom searx.utils import eval_xpath, eval_xpath_list, eval_xpath_getindex# about@@ -50,7 +51,7 @@ def request(query, params):# basic searchoffset = (params['pageno'] - 1) * number_of_results- string_args = dict(query=query, offset=offset, number_of_results=number_of_results)+ string_args = {'query': query, 'offset': offset, 'number_of_results': number_of_results}params['url'] = base_url.format(**string_args)diff --git a/searx/engines/ask.py b/searx/engines/ask.pyindex ff4413e1a..2f2ce4e51 100644--- a/searx/engines/ask.py+++ b/searx/engines/ask.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Ask.com"""from urllib.parse import urlencodediff --git a/searx/engines/bandcamp.py b/searx/engines/bandcamp.pyindex 8feff1fe0..382e32e30 100644--- a/searx/engines/bandcamp.py+++ b/searx/engines/bandcamp.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Bandcamp (Music)@website https://bandcamp.com/diff --git a/searx/engines/base.py b/searx/engines/base.pyindex 5a2d66619..5cfcc9250 100755--- a/searx/engines/base.py+++ b/searx/engines/base.py@@ -1,12 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-or-later+"""BASE (Scholar publications)+"""- BASE (Scholar publications)-"""+from datetime import datetime+import refrom urllib.parse import urlencodefrom lxml import etree-from datetime import datetime-import refrom searx.utils import searx_useragent# about@@ -55,13 +55,17 @@ shorcut_dict = {def request(query, params):# replace shortcuts with API advanced search keywords- for key in shorcut_dict.keys():- query = re.sub(key, shorcut_dict[key], query)+ for key, val in shorcut_dict.items():+ query = re.sub(key, val, query)# basic searchoffset = (params['pageno'] - 1) * number_of_results- string_args = dict(query=urlencode({'query': query}), offset=offset, hits=number_of_results)+ string_args = {+ 'query': urlencode({'query': query}),+ 'offset': offset,+ 'hits': number_of_results,+ }params['url'] = base_url.format(**string_args)@@ -99,7 +103,7 @@ def response(resp):try:publishedDate = datetime.strptime(date, date_format)break- except:+ except: # pylint: disable=bare-exceptpassif publishedDate is not None:diff --git a/searx/engines/bilibili.py b/searx/engines/bilibili.pyindex 642b33e1a..f26f2164f 100644--- a/searx/engines/bilibili.py+++ b/searx/engines/bilibili.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Bilibili is a Chinese video sharing website... _Bilibili: https://www.bilibili.comdiff --git a/searx/engines/bing.py b/searx/engines/bing.pyindex ff15f0b22..adb8e90a3 100644--- a/searx/engines/bing.py+++ b/searx/engines/bing.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Bing-WEB engine. Some of thisimplementations are shared by other engines:diff --git a/searx/engines/bing_images.py b/searx/engines/bing_images.pyindex 788c90278..1ee09d165 100644--- a/searx/engines/bing_images.py+++ b/searx/engines/bing_images.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Bing-Images: description see :py:obj:`searx.engines.bing`."""# pylint: disable=invalid-namediff --git a/searx/engines/bing_news.py b/searx/engines/bing_news.pyindex 3585a1cd1..459927fd7 100644--- a/searx/engines/bing_news.py+++ b/searx/engines/bing_news.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Bing-News: description see :py:obj:`searx.engines.bing`... hint::diff --git a/searx/engines/bing_videos.py b/searx/engines/bing_videos.pyindex 41bf2d3e1..f76820415 100644--- a/searx/engines/bing_videos.py+++ b/searx/engines/bing_videos.py@@ -1,8 +1,7 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint+# pylint: disable=invalid-name"""Bing-Videos: description see :py:obj:`searx.engines.bing`."""-# pylint: disable=invalid-namefrom typing import TYPE_CHECKINGimport jsondiff --git a/searx/engines/bpb.py b/searx/engines/bpb.pyindex 5d6359aae..8be451f95 100644--- a/searx/engines/bpb.py+++ b/searx/engines/bpb.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""BPB refers to ``Bundeszentrale für poltische Bildung``, which is a Germangovernmental institution aiming to reduce misinformation by providing resourcesabout politics and history.diff --git a/searx/engines/brave.py b/searx/engines/brave.pyindex 8588c2efd..6d4ab3a44 100644--- a/searx/engines/brave.py+++ b/searx/engines/brave.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Brave supports the categories listed in :py:obj:`brave_category` (General,news, videos, images). The support of :py:obj:`paging` and :py:obj:`time range<time_range_support>` is limited (see remarks).diff --git a/searx/engines/bt4g.py b/searx/engines/bt4g.pyindex 786aa1920..98a8c3087 100644--- a/searx/engines/bt4g.py+++ b/searx/engines/bt4g.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""BT4G_ (bt4g.com) is not a tracker and doesn't store any content and onlycollects torrent metadata (such as file names and file sizes) and a magnet link(torrent identifier).diff --git a/searx/engines/btdigg.py b/searx/engines/btdigg.pyindex c5dd92105..588d62093 100644--- a/searx/engines/btdigg.py+++ b/searx/engines/btdigg.py@@ -3,8 +3,9 @@BTDigg (Videos, Music, Files)"""-from lxml import htmlfrom urllib.parse import quote, urljoin++from lxml import htmlfrom searx.utils import extract_text, get_torrent_size# about@@ -67,7 +68,7 @@ def response(resp):# convert files to int if possibletry:files = int(files)- except:+ except: # pylint: disable=bare-exceptfiles = Nonemagnetlink = result.xpath('.//div[@class="torrent_magnet"]//a')[0].attrib['href']diff --git a/searx/engines/chefkoch.py b/searx/engines/chefkoch.pyindex 9dc6ae0dd..cffa59a0f 100644--- a/searx/engines/chefkoch.py+++ b/searx/engines/chefkoch.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Chefkoch is a German database of recipes."""diff --git a/searx/engines/command.py b/searx/engines/command.pyindex ffb87509a..176388e3a 100644--- a/searx/engines/command.py+++ b/searx/engines/command.py@@ -106,7 +106,7 @@ def init(engine_settings):if 'command' not in engine_settings:raise ValueError('engine command : missing configuration key: command')- global command, working_dir, delimiter, parse_regex, environment_variables+ global command, working_dir, delimiter, parse_regex, environment_variables # pylint: disable=global-statementcommand = engine_settings['command']@@ -172,7 +172,7 @@ def _get_results_from_process(results, cmd, pageno):_command_logger.debug('skipped result:', raw_result)continue- if start <= count and count <= end:+ if start <= count and count <= end: # pylint: disable=chained-comparisonresult['template'] = result_templateresults.append(result)@@ -185,6 +185,7 @@ def _get_results_from_process(results, cmd, pageno):return_code = process.wait(timeout=timeout)if return_code != 0:raise RuntimeError('non-zero return code when running command', cmd, return_code)+ return Nonedef __get_results_limits(pageno):@@ -230,7 +231,7 @@ def __parse_single_result(raw_result):elements = raw_result.split(delimiter['chars'], maxsplit=len(delimiter['keys']) - 1)if len(elements) != len(delimiter['keys']):return {}- for i in range(len(elements)):+ for i in range(len(elements)): # pylint: disable=consider-using-enumerateresult[delimiter['keys'][i]] = elements[i]if parse_regex:diff --git a/searx/engines/core.py b/searx/engines/core.pyindex 2fa66e226..5305cb224 100644--- a/searx/engines/core.py+++ b/searx/engines/core.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""CORE (science)"""diff --git a/searx/engines/cppreference.py b/searx/engines/cppreference.pyindex b13cf730b..5ffbf6e59 100644--- a/searx/engines/cppreference.py+++ b/searx/engines/cppreference.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Cppreference"""from lxml import htmldiff --git a/searx/engines/crossref.py b/searx/engines/crossref.pyindex c2ed7763f..d8dfc568d 100644--- a/searx/engines/crossref.py+++ b/searx/engines/crossref.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""CrossRef"""from urllib.parse import urlencodediff --git a/searx/engines/currency_convert.py b/searx/engines/currency_convert.pyindex 2e87ef751..cbb1d6cc4 100644--- a/searx/engines/currency_convert.py+++ b/searx/engines/currency_convert.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Currency convert (DuckDuckGo)"""diff --git a/searx/engines/dailymotion.py b/searx/engines/dailymotion.pyindex 99da9616c..4dfca9ef3 100644--- a/searx/engines/dailymotion.py+++ b/searx/engines/dailymotion.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Dailymotion (Videos)~~~~~~~~~~~~~~~~~~~~diff --git a/searx/engines/deepl.py b/searx/engines/deepl.pyindex 85072710f..9e4fbe21e 100644--- a/searx/engines/deepl.py+++ b/searx/engines/deepl.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Deepl translation engine"""from json import loadsdiff --git a/searx/engines/deezer.py b/searx/engines/deezer.pyindex 3dd787c48..f4a4783ea 100644--- a/searx/engines/deezer.py+++ b/searx/engines/deezer.py@@ -45,7 +45,7 @@ def response(resp):for result in search_res.get('data', []):if result['type'] == 'track':title = result['title']- url = result['link']+ url = result['link'] # pylint: disable=redefined-outer-nameif url.startswith('http://'):url = 'https' + url[4:]diff --git a/searx/engines/demo_offline.py b/searx/engines/demo_offline.pyindex 9d6e3b52d..97659465a 100644--- a/searx/engines/demo_offline.py+++ b/searx/engines/demo_offline.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Within this module we implement a *demo offline engine*. Do not look toclose to the implementation, its just a simple example. To get in use of this*demo* engine add the following entry to your engines list in ``settings.yml``:diff --git a/searx/engines/demo_online.py b/searx/engines/demo_online.pyindex 33cfde822..6accc0033 100644--- a/searx/engines/demo_online.py+++ b/searx/engines/demo_online.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Within this module we implement a *demo online engine*. Do not look toclose to the implementation, its just a simple example which queries `The ArtInstitute of Chicago <https://www.artic.edu>`_diff --git a/searx/engines/destatis.py b/searx/engines/destatis.pyindex 2d19b340f..9e5355c6f 100644--- a/searx/engines/destatis.py+++ b/searx/engines/destatis.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""DeStatis"""diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.pyindex fa88d9389..b19813a35 100644--- a/searx/engines/deviantart.py+++ b/searx/engines/deviantart.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Deviantart (Images)"""diff --git a/searx/engines/dictzone.py b/searx/engines/dictzone.pyindex 126e75374..a6e1ae289 100644--- a/searx/engines/dictzone.py+++ b/searx/engines/dictzone.py@@ -26,7 +26,7 @@ results_xpath = './/table[@id="r"]/tr'https_support = True-def request(query, params):+def request(query, params): # pylint: disable=unused-argumentparams['url'] = url.format(from_lang=params['from_lang'][2], to_lang=params['to_lang'][2], query=params['query'])return params@@ -40,7 +40,7 @@ def response(resp):for k, result in enumerate(eval_xpath(dom, results_xpath)[1:]):try:from_result, to_results_raw = eval_xpath(result, './td')- except:+ except: # pylint: disable=bare-exceptcontinueto_results = []diff --git a/searx/engines/digbt.py b/searx/engines/digbt.pyindex 2914e9228..ae78f1a9e 100644--- a/searx/engines/digbt.py+++ b/searx/engines/digbt.py@@ -37,9 +37,9 @@ def response(resp):search_res = dom.xpath('.//td[@class="x-item"]')if not search_res:- return list()+ return []- results = list()+ results = []for result in search_res:url = urljoin(URL, result.xpath('.//a[@title]/@href')[0])title = extract_text(result.xpath('.//a[@title]'))diff --git a/searx/engines/docker_hub.py b/searx/engines/docker_hub.pyindex 1e2527823..48b4dcf0e 100644--- a/searx/engines/docker_hub.py+++ b/searx/engines/docker_hub.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Docker Hub (IT)"""diff --git a/searx/engines/doku.py b/searx/engines/doku.pyindex 08f56bbe7..dfe643c9e 100644--- a/searx/engines/doku.py+++ b/searx/engines/doku.py@@ -18,7 +18,7 @@ about = {}# engine dependent config-categories = ['general'] # TODO , 'images', 'music', 'videos', 'files'+categories = ['general'] # 'images', 'music', 'videos', 'files'paging = Falsenumber_of_results = 5@@ -31,8 +31,8 @@ search_url = ('&{query}'# fmt: on)-# TODO '&startRecord={offset}'-# TODO '&maximumRecords={limit}'+# '&startRecord={offset}'+# '&maximumRecords={limit}'# do search-request@@ -54,7 +54,7 @@ def response(resp):for r in eval_xpath(doc, '//div[@class="search_quickresult"]/ul/li'):try:res_url = eval_xpath(r, './/a[@class="wikilink1"]/@href')[-1]- except:+ except: # pylint: disable=bare-exceptcontinueif not res_url:@@ -76,7 +76,7 @@ def response(resp):# append resultresults.append({'title': title, 'content': content, 'url': base_url + res_url})- except:+ except: # pylint: disable=bare-exceptcontinueif not res_url:diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.pyindex 636dfccd5..ac78c3b60 100644--- a/searx/engines/duckduckgo.py+++ b/searx/engines/duckduckgo.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""DuckDuckGo Lite~~~~~~~~~~~~~~~diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.pyindex 49f9dee34..e8146cc3e 100644--- a/searx/engines/duckduckgo_definitions.py+++ b/searx/engines/duckduckgo_definitions.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""DuckDuckGo Instant Answer API~~~~~~~~~~~~~~~~~~~~~~~~~~~~~diff --git a/searx/engines/duckduckgo_weather.py b/searx/engines/duckduckgo_weather.pyindex 3d59c4b0a..715b0dfd1 100644--- a/searx/engines/duckduckgo_weather.py+++ b/searx/engines/duckduckgo_weather.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""DuckDuckGo Weather~~~~~~~~~~~~~~~~~~diff --git a/searx/engines/dummy-offline.py b/searx/engines/dummy-offline.pyindex 632eeb2b3..545c947ff 100644--- a/searx/engines/dummy-offline.py+++ b/searx/engines/dummy-offline.py@@ -1,6 +1,7 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Dummy Offline+# pylint: disable=invalid-name+"""Dummy Offline+"""@@ -14,7 +15,7 @@ about = {}-def search(query, request_params):+def search(query, request_params): # pylint: disable=unused-argumentreturn [{'result': 'this is what you get',diff --git a/searx/engines/dummy.py b/searx/engines/dummy.pyindex 1a1b57d8c..2d4301b42 100644--- a/searx/engines/dummy.py+++ b/searx/engines/dummy.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Dummy+"""Dummy+"""# about@@ -15,10 +15,10 @@ about = {# do search-request-def request(query, params):+def request(query, params): # pylint: disable=unused-argumentreturn params# get response from search-request-def response(resp):+def response(resp): # pylint: disable=unused-argumentreturn []diff --git a/searx/engines/ebay.py b/searx/engines/ebay.pyindex 07870f044..f1d09d878 100644--- a/searx/engines/ebay.py+++ b/searx/engines/ebay.py@@ -3,9 +3,10 @@Ebay (Videos, Music, Files)"""+from urllib.parse import quote+from lxml import htmlfrom searx.engines.xpath import extract_text-from urllib.parse import quote# aboutabout = {diff --git a/searx/engines/emojipedia.py b/searx/engines/emojipedia.pyindex a1f3ef7b8..9bda21234 100644--- a/searx/engines/emojipedia.py+++ b/searx/engines/emojipedia.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""EmojipediaEmojipedia is an emoji reference website which documents the meaning anddiff --git a/searx/engines/flickr.py b/searx/engines/flickr.pyindex b7cd76808..89c3b8cfd 100644--- a/searx/engines/flickr.py+++ b/searx/engines/flickr.py@@ -78,12 +78,10 @@ def response(resp):else:thumbnail_src = img_src- url = build_flickr_url(photo['owner'], photo['id'])-# append resultresults.append({- 'url': url,+ 'url': build_flickr_url(photo['owner'], photo['id']),'title': photo['title'],'img_src': img_src,'thumbnail_src': thumbnail_src,diff --git a/searx/engines/flickr_noapi.py b/searx/engines/flickr_noapi.pyindex ebd61570f..6d5fd84d1 100644--- a/searx/engines/flickr_noapi.py+++ b/searx/engines/flickr_noapi.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Flickr (Images)"""diff --git a/searx/engines/fyyd.py b/searx/engines/fyyd.pyindex 10ba91f7f..3810e5e81 100644--- a/searx/engines/fyyd.py+++ b/searx/engines/fyyd.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Fyyd (podcasts)"""diff --git a/searx/engines/genius.py b/searx/engines/genius.pyindex db1f66603..b25b01568 100644--- a/searx/engines/genius.py+++ b/searx/engines/genius.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint# pylint: disable=invalid-name"""Geniusdiff --git a/searx/engines/gentoo.py b/searx/engines/gentoo.pyindex cf193c2a3..4a4e085ba 100644--- a/searx/engines/gentoo.py+++ b/searx/engines/gentoo.py@@ -107,7 +107,7 @@ def request(query, params):def response(resp):# get the base URL for the language in which request was madelanguage = locale_to_lang_code(resp.search_params['language'])- base_url = get_lang_urls(language)['base']+ url = get_lang_urls(language)['base']results = []@@ -116,7 +116,7 @@ def response(resp):# parse resultsfor result in dom.xpath(xpath_results):link = result.xpath(xpath_link)[0]- href = urljoin(base_url, link.attrib.get('href'))+ href = urljoin(url, link.attrib.get('href'))title = extract_text(link)content = extract_text(result.xpath(xpath_content))diff --git a/searx/engines/github.py b/searx/engines/github.pyindex 36eca4c53..a20f14d14 100644--- a/searx/engines/github.py+++ b/searx/engines/github.py@@ -1,7 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint-"""Github (IT)+"""from urllib.parse import urlencodediff --git a/searx/engines/goodreads.py b/searx/engines/goodreads.pyindex 7af04ae58..eb5c25605 100644--- a/searx/engines/goodreads.py+++ b/searx/engines/goodreads.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Goodreads (books)"""diff --git a/searx/engines/google.py b/searx/engines/google.pyindex 0bf7fdb01..fd59a0e2e 100644--- a/searx/engines/google.py+++ b/searx/engines/google.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Google WEB engine. Some of thisimplementations (manly the :py:obj:`get_google_info`) are shared by otherengines:diff --git a/searx/engines/google_images.py b/searx/engines/google_images.pyindex 31211b9b6..edd386641 100644--- a/searx/engines/google_images.py+++ b/searx/engines/google_images.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Google Images engine using the internalGoogle API used by the Google Go Android app.diff --git a/searx/engines/google_news.py b/searx/engines/google_news.pyindex a5ed63bbe..6f5db041e 100644--- a/searx/engines/google_news.py+++ b/searx/engines/google_news.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Google News engine.Google News has a different region handling compared to Google WEB.diff --git a/searx/engines/google_play.py b/searx/engines/google_play.pyindex a9cfd1a76..f8ab02c27 100644--- a/searx/engines/google_play.py+++ b/searx/engines/google_play.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Google Play Apps & Google Play Movies"""diff --git a/searx/engines/google_scholar.py b/searx/engines/google_scholar.pyindex 8d11c956f..8b47360a8 100644--- a/searx/engines/google_scholar.py+++ b/searx/engines/google_scholar.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Google Scholar engine.Compared to other Google services the Scholar engine has a simple GET REST-APIdiff --git a/searx/engines/google_videos.py b/searx/engines/google_videos.pyindex 334358446..4a5818f7e 100644--- a/searx/engines/google_videos.py+++ b/searx/engines/google_videos.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Google Videos engine... admonition:: Content-Security-Policy (CSP)diff --git a/searx/engines/hackernews.py b/searx/engines/hackernews.pyindex 4183874f2..a9e29bf0a 100644--- a/searx/engines/hackernews.py+++ b/searx/engines/hackernews.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Hackernews"""diff --git a/searx/engines/imdb.py b/searx/engines/imdb.pyindex 0c6f2d5f0..b0938b523 100644--- a/searx/engines/imdb.py+++ b/searx/engines/imdb.py@@ -1,6 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint-"""IMDB - Internet Movie DatabaseRetrieves results from a basic search. Advanced search options are notdiff --git a/searx/engines/imgur.py b/searx/engines/imgur.pyindex 2fe050705..7a4793c58 100644--- a/searx/engines/imgur.py+++ b/searx/engines/imgur.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Imgur (images)"""diff --git a/searx/engines/internet_archive_scholar.py b/searx/engines/internet_archive_scholar.pyindex a4f1ddd03..d3956eb71 100644--- a/searx/engines/internet_archive_scholar.py+++ b/searx/engines/internet_archive_scholar.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Internet Archive scholar(science)"""diff --git a/searx/engines/invidious.py b/searx/engines/invidious.pyindex 566b0cf98..49f90cc09 100644--- a/searx/engines/invidious.py+++ b/searx/engines/invidious.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Invidious (Videos)"""diff --git a/searx/engines/json_engine.py b/searx/engines/json_engine.pyindex 9bf5f5c28..47cf16372 100644--- a/searx/engines/json_engine.py+++ b/searx/engines/json_engine.py@@ -1,4 +1,15 @@# SPDX-License-Identifier: AGPL-3.0-or-later+"""The JSON engine is a *generic* engine with which it is possible to configure+engines in the settings.++.. todo::++ - The JSON engine needs documentation!!++ - The parameters of the JSON engine should be adapted to those of the XPath+ engine.++"""from collections.abc import Iterablefrom json import loads@@ -32,32 +43,31 @@ first_page_num = 1def iterate(iterable):- if type(iterable) == dict:- it = iterable.items()+ if isinstance(iterable, dict):+ items = iterable.items()else:- it = enumerate(iterable)- for index, value in it:+ items = enumerate(iterable)+ for index, value in items:yield str(index), valuedef is_iterable(obj):- if type(obj) == str:+ if isinstance(obj, str):return Falsereturn isinstance(obj, Iterable)-def parse(query):- q = []+def parse(query): # pylint: disable=redefined-outer-name+ q = [] # pylint: disable=invalid-namefor part in query.split('/'):if part == '':continue- else:- q.append(part)+ q.append(part)return q-def do_query(data, q):+def do_query(data, q): # pylint: disable=invalid-nameret = []if not q:return ret@@ -87,10 +97,10 @@ def query(data, query_string):return do_query(data, q)-def request(query, params):+def request(query, params): # pylint: disable=redefined-outer-namequery = urlencode({'q': query})[2:]- fp = {'query': query}+ fp = {'query': query} # pylint: disable=invalid-nameif paging and search_url.find('{pageno}') >= 0:fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num@@ -115,18 +125,18 @@ def response(resp):content_filter = html_to_text if content_html_to_text else identityif results_query:- rs = query(json, results_query)- if not len(rs):+ rs = query(json, results_query) # pylint: disable=invalid-name+ if not rs:return resultsfor result in rs[0]:try:url = query(result, url_query)[0]title = query(result, title_query)[0]- except:+ except: # pylint: disable=bare-exceptcontinuetry:content = query(result, content_query)[0]- except:+ except: # pylint: disable=bare-exceptcontent = ""results.append({diff --git a/searx/engines/kickass.py b/searx/engines/kickass.pyindex bda50179b..12bf9c04d 100644--- a/searx/engines/kickass.py+++ b/searx/engines/kickass.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Kickass Torrent (Videos, Music, Files)"""import randomdiff --git a/searx/engines/lemmy.py b/searx/engines/lemmy.pyindex bc3cc9cf6..a924b4bc4 100644--- a/searx/engines/lemmy.py+++ b/searx/engines/lemmy.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This engine uses the Lemmy API (https://lemmy.ml/api/v3/search), which isdocumented at `lemmy-js-client`_ / `Interface Search`_. Since Lemmy isfederated, results are from many different, independent lemmy instances, and notdiff --git a/searx/engines/lib_rs.py b/searx/engines/lib_rs.pyindex c9435cc2a..79a69d19e 100644--- a/searx/engines/lib_rs.py+++ b/searx/engines/lib_rs.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""lib.rs (packages)"""from urllib.parse import quote_plusdiff --git a/searx/engines/lingva.py b/searx/engines/lingva.pyindex cc5646050..dac574afa 100644--- a/searx/engines/lingva.py+++ b/searx/engines/lingva.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Lingva (alternative Google Translate frontend)"""from json import loadsdiff --git a/searx/engines/livespace.py b/searx/engines/livespace.pyindex 3f466bbf0..6a9056779 100755--- a/searx/engines/livespace.py+++ b/searx/engines/livespace.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""LiveSpace (Videos).. hint::diff --git a/searx/engines/mastodon.py b/searx/engines/mastodon.pyindex 1f9d4014f..b7b05cfb5 100644--- a/searx/engines/mastodon.py+++ b/searx/engines/mastodon.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Mastodon_ is an open source alternative to large social media platforms likeTwitter/X, Facebook, ...diff --git a/searx/engines/material_icons.py b/searx/engines/material_icons.pyindex 68b17f4c6..381cedae1 100644--- a/searx/engines/material_icons.py+++ b/searx/engines/material_icons.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Material Icons (images)+"""import rediff --git a/searx/engines/mediathekviewweb.py b/searx/engines/mediathekviewweb.pyindex 5570ebe24..6d2331a3d 100644--- a/searx/engines/mediathekviewweb.py+++ b/searx/engines/mediathekviewweb.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""MediathekViewWeb (API)"""diff --git a/searx/engines/mediawiki.py b/searx/engines/mediawiki.pyindex 6a9ac974a..76317402e 100644--- a/searx/engines/mediawiki.py+++ b/searx/engines/mediawiki.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""The MediaWiki engine is a *generic* engine to **query** Wikimedia wikis bythe `MediaWiki Action API`_. For a `query action`_ all Wikimedia wikis haveendpoints that follow this pattern::diff --git a/searx/engines/meilisearch.py b/searx/engines/meilisearch.pyindex 0c2370216..e22674251 100644--- a/searx/engines/meilisearch.py+++ b/searx/engines/meilisearch.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint""".. sidebar:: info- :origin:`meilisearch.py <searx/engines/meilisearch.py>`diff --git a/searx/engines/metacpan.py b/searx/engines/metacpan.pyindex 9d7f539e9..50608bc11 100644--- a/searx/engines/metacpan.py+++ b/searx/engines/metacpan.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""metacpan"""diff --git a/searx/engines/mixcloud.py b/searx/engines/mixcloud.pyindex 3f255697e..d6618aa6a 100644--- a/searx/engines/mixcloud.py+++ b/searx/engines/mixcloud.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Mixcloud (Music)"""diff --git a/searx/engines/mongodb.py b/searx/engines/mongodb.pyindex 260d6da97..57eaa8537 100644--- a/searx/engines/mongodb.py+++ b/searx/engines/mongodb.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""MongoDB_ is a document based database program that handles JSON like data.Before configuring the ``mongodb`` engine, you must install the dependencypymongo_.diff --git a/searx/engines/moviepilot.py b/searx/engines/moviepilot.pyindex f9206c74c..645936d9f 100644--- a/searx/engines/moviepilot.py+++ b/searx/engines/moviepilot.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Moviepilot is a German movie database, similar to IMDB or TMDB. It doesn'thave any official API, but it uses JSON requests internally to fetch searchresults and suggestions, that's being used in this implementation.diff --git a/searx/engines/mozhi.py b/searx/engines/mozhi.pyindex 3494e1863..f6fdee566 100644--- a/searx/engines/mozhi.py+++ b/searx/engines/mozhi.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Mozhi (alternative frontend for popular translation engines)"""import randomdiff --git a/searx/engines/mrs.py b/searx/engines/mrs.pyindex 68e34d21d..c4bb54eb8 100644--- a/searx/engines/mrs.py+++ b/searx/engines/mrs.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Matrix Rooms Search - a fully-featured, standalone, matrix rooms search service.Configurationdiff --git a/searx/engines/mullvad_leta.py b/searx/engines/mullvad_leta.pyindex 121331bf3..6e46163e3 100644--- a/searx/engines/mullvad_leta.py+++ b/searx/engines/mullvad_leta.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This is the implementation of the Mullvad-Leta meta-search engine.diff --git a/searx/engines/mwmbl.py b/searx/engines/mwmbl.pyindex f4905401d..01d5e692f 100644--- a/searx/engines/mwmbl.py+++ b/searx/engines/mwmbl.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Mwmbl_ is a non-profit, ad-free, free-libre and free-lunch search engine witha focus on useability and speed.diff --git a/searx/engines/mysql_server.py b/searx/engines/mysql_server.pyindex 82bb37f51..369b2b7fe 100644--- a/searx/engines/mysql_server.py+++ b/searx/engines/mysql_server.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""MySQL is said to be the most popular open source database. Before enablingMySQL engine, you must install the package ``mysql-connector-python``.diff --git a/searx/engines/npm.py b/searx/engines/npm.pyindex 0fef2dda8..ac21a62b8 100644--- a/searx/engines/npm.py+++ b/searx/engines/npm.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""npms.io"""diff --git a/searx/engines/nyaa.py b/searx/engines/nyaa.pyindex 1e9d846be..c22339dbf 100644--- a/searx/engines/nyaa.py+++ b/searx/engines/nyaa.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Nyaa.si (Anime Bittorrent tracker)"""diff --git a/searx/engines/odysee.py b/searx/engines/odysee.pyindex 3189ab4c6..595c92b47 100644--- a/searx/engines/odysee.py+++ b/searx/engines/odysee.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Odysee_ is a decentralized video hosting platform... _Odysee: https://github.com/OdyseeTeam/odysee-frontenddiff --git a/searx/engines/opensemantic.py b/searx/engines/opensemantic.pyindex 64bc321f1..03b01df43 100644--- a/searx/engines/opensemantic.py+++ b/searx/engines/opensemantic.py@@ -1,11 +1,11 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Open Semantic Search+"""Open Semantic Search+"""-from dateutil import parserfrom json import loadsfrom urllib.parse import quote+from dateutil import parser# aboutabout = {diff --git a/searx/engines/openstreetmap.py b/searx/engines/openstreetmap.pyindex 68ec0549e..7e3d8f43b 100644--- a/searx/engines/openstreetmap.py+++ b/searx/engines/openstreetmap.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""OpenStreetMap (Map)"""diff --git a/searx/engines/pdbe.py b/searx/engines/pdbe.pyindex a0526057d..96e3509c2 100644--- a/searx/engines/pdbe.py+++ b/searx/engines/pdbe.py@@ -96,7 +96,7 @@ def response(resp):title = gettext('{title} (OBSOLETE)').format(title=result['title'])try:superseded_url = pdbe_entry_url.format(pdb_id=result['superseded_by'])- except:+ except: # pylint: disable=bare-exceptcontinue# since we can't construct a proper body from the response, we'll make up our owndiff --git a/searx/engines/peertube.py b/searx/engines/peertube.pyindex d0eba6b88..114e24c4f 100644--- a/searx/engines/peertube.py+++ b/searx/engines/peertube.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Peertube and :py:obj:`SepiaSearch <searx.engines.sepiasearch>` do share(more or less) the same REST API and the schema of the JSON result is identical.diff --git a/searx/engines/photon.py b/searx/engines/photon.pyindex 2ea393679..43c41bf46 100644--- a/searx/engines/photon.py+++ b/searx/engines/photon.py@@ -87,7 +87,7 @@ def response(resp):properties.get('extent')[2],]else:- # TODO: better boundingbox calculation+ # better boundingbox calculation?boundingbox = [geojson['coordinates'][1],geojson['coordinates'][1],diff --git a/searx/engines/pinterest.py b/searx/engines/pinterest.pyindex 756c1b8e0..841b98ba0 100644--- a/searx/engines/pinterest.py+++ b/searx/engines/pinterest.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Pinterest (images)"""diff --git a/searx/engines/piped.py b/searx/engines/piped.pyindex 5b4cbded3..09ef48fe6 100644--- a/searx/engines/piped.py+++ b/searx/engines/piped.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""An alternative privacy-friendly YouTube frontend which is efficient bydesign. `Piped’s architecture`_ consists of 3 components:diff --git a/searx/engines/piratebay.py b/searx/engines/piratebay.pyindex 4b0984be5..ba58e64fc 100644--- a/searx/engines/piratebay.py+++ b/searx/engines/piratebay.py@@ -82,14 +82,14 @@ def response(resp):try:date = datetime.fromtimestamp(float(result["added"]))params['publishedDate'] = date- except:+ except: # pylint: disable=bare-exceptpass# let's try to calculate the torrent sizetry:filesize = get_torrent_size(result["size"], "B")params['filesize'] = filesize- except:+ except: # pylint: disable=bare-exceptpass# append resultdiff --git a/searx/engines/pixiv.py b/searx/engines/pixiv.pyindex fdb74e818..abf316228 100644--- a/searx/engines/pixiv.py+++ b/searx/engines/pixiv.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Pixiv (images)"""from urllib.parse import urlencodediff --git a/searx/engines/pkg_go_dev.py b/searx/engines/pkg_go_dev.pyindex dcbd88451..60d65fd4f 100644--- a/searx/engines/pkg_go_dev.py+++ b/searx/engines/pkg_go_dev.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""pkg.go.dev (packages)"""import rediff --git a/searx/engines/podcastindex.py b/searx/engines/podcastindex.pyindex 7f1e2cd02..d0aa85fb8 100644--- a/searx/engines/podcastindex.py+++ b/searx/engines/podcastindex.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Podcast Index"""diff --git a/searx/engines/postgresql.py b/searx/engines/postgresql.pyindex c0277207c..e7def0635 100644--- a/searx/engines/postgresql.py+++ b/searx/engines/postgresql.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""PostgreSQL is a powerful and robust open source database. Before configuringthe PostgreSQL engine, you must install the dependency ``psychopg2``.diff --git a/searx/engines/presearch.py b/searx/engines/presearch.pyindex baf692d60..88fa59f0e 100644--- a/searx/engines/presearch.py+++ b/searx/engines/presearch.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Presearch supports the search types listed in :py:obj:`search_type` (general,images, videos, news).diff --git a/searx/engines/pubmed.py b/searx/engines/pubmed.pyindex b6ffd039f..be934cdc8 100644--- a/searx/engines/pubmed.py+++ b/searx/engines/pubmed.py@@ -1,11 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- PubMed (Scholar publications)+"""PubMed (Scholar publications)+"""-from lxml import etreefrom datetime import datetimefrom urllib.parse import urlencode++from lxml import etreefrom searx.network import getfrom searx.utils import (eval_xpath_getindex,@@ -41,14 +42,18 @@ def request(query, params):# basic searchoffset = (params['pageno'] - 1) * number_of_results- string_args = dict(query=urlencode({'term': query}), offset=offset, hits=number_of_results)+ string_args = {+ 'query': urlencode({'term': query}),+ 'offset': offset,+ 'hits': number_of_results,+ }params['url'] = base_url.format(**string_args)return params-def response(resp):+def response(resp): # pylint: disable=too-many-localsresults = []# First retrieve notice of each result@@ -63,7 +68,7 @@ def response(resp):for item in pmids:pmids_string += item.text + ','- retrieve_notice_args = dict(pmids_string=pmids_string)+ retrieve_notice_args = {'pmids_string': pmids_string}retrieve_url_encoded = pubmed_retrieve_api_url.format(**retrieve_notice_args)@@ -119,7 +124,7 @@ def response(resp):'%Y-%m-%d',)res_dict['publishedDate'] = publishedDate- except Exception as e:+ except Exception as e: # pylint: disable=broad-exception-caughtprint(e)results.append(res_dict)diff --git a/searx/engines/pypi.py b/searx/engines/pypi.pyindex e49de11e5..7ebb254f3 100644--- a/searx/engines/pypi.py+++ b/searx/engines/pypi.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""pypi.org"""diff --git a/searx/engines/qwant.py b/searx/engines/qwant.pyindex 775a11292..46edb6958 100644--- a/searx/engines/qwant.py+++ b/searx/engines/qwant.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This engine uses the Qwant API (https://api.qwant.com/v3) to implement Qwant-Web, -News, -Images and -Videos. The API is undocumented but can be reverseengineered by reading the network log of https://www.qwant.com/ queries.diff --git a/searx/engines/radio_browser.py b/searx/engines/radio_browser.pyindex 6b60b398e..3c06159a2 100644--- a/searx/engines/radio_browser.py+++ b/searx/engines/radio_browser.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Search radio stations from RadioBrowser by `Advanced station search API`_... _Advanced station search API:diff --git a/searx/engines/recoll.py b/searx/engines/recoll.pyindex c11e197ed..b9e87a723 100644--- a/searx/engines/recoll.py+++ b/searx/engines/recoll.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint""".. sidebar:: info- `Recoll <https://www.lesbonscomptes.com/recoll/>`_diff --git a/searx/engines/reddit.py b/searx/engines/reddit.pyindex 36d92339d..263b70b73 100644--- a/searx/engines/reddit.py+++ b/searx/engines/reddit.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint+"""import jsondiff --git a/searx/engines/redis_server.py b/searx/engines/redis_server.pyindex 980812509..3268378c6 100644--- a/searx/engines/redis_server.py+++ b/searx/engines/redis_server.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Redis is an open source (BSD licensed), in-memory data structure (key valuebased) store. Before configuring the ``redis_server`` engine, you must installthe dependency redis_.diff --git a/searx/engines/rottentomatoes.py b/searx/engines/rottentomatoes.pyindex 727287355..0cac6e247 100644--- a/searx/engines/rottentomatoes.py+++ b/searx/engines/rottentomatoes.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""RottenTomatoes (movies)"""diff --git a/searx/engines/rumble.py b/searx/engines/rumble.pyindex e4a50c732..5267e04c0 100644--- a/searx/engines/rumble.py+++ b/searx/engines/rumble.py@@ -1,10 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-or-later+"""Rumble (Videos)+"""- Rumble (Videos)-"""++from datetime import datetime+from urllib.parse import urlencodefrom lxml import html-from datetime import datetime# aboutfrom searx.utils import extract_textdiff --git a/searx/engines/searchcode_code.py b/searx/engines/searchcode_code.pyindex a53c72094..7cfe2ce71 100644--- a/searx/engines/searchcode_code.py+++ b/searx/engines/searchcode_code.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Searchcode (IT)"""diff --git a/searx/engines/searx_engine.py b/searx/engines/searx_engine.pyindex 84a8e6449..156001997 100644--- a/searx/engines/searx_engine.py+++ b/searx/engines/searx_engine.py@@ -25,7 +25,7 @@ instance_index = 0# do search-requestdef request(query, params):- global instance_index+ global instance_index # pylint: disable=global-statementparams['url'] = instance_urls[instance_index % len(instance_urls)]params['method'] = 'POST'diff --git a/searx/engines/seekr.py b/searx/engines/seekr.pyindex 014b736dc..967eef86d 100644--- a/searx/engines/seekr.py+++ b/searx/engines/seekr.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""seekr.com Seeker ScoreSeekr is a privately held search and content evaluation engine that prioritizesdiff --git a/searx/engines/semantic_scholar.py b/searx/engines/semantic_scholar.pyindex 7838a7d55..cc65ff542 100644--- a/searx/engines/semantic_scholar.py+++ b/searx/engines/semantic_scholar.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Semantic Scholar (Science)"""diff --git a/searx/engines/sepiasearch.py b/searx/engines/sepiasearch.pyindex 72157b253..76376277e 100644--- a/searx/engines/sepiasearch.py+++ b/searx/engines/sepiasearch.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""SepiaSearch uses the same languages as :py:obj:`Peertube<searx.engines.peertube>` and the response is identical to the response from thepeertube engines.diff --git a/searx/engines/seznam.py b/searx/engines/seznam.pyindex 36a38848a..d480956bd 100644--- a/searx/engines/seznam.py+++ b/searx/engines/seznam.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Seznam"""diff --git a/searx/engines/sjp.py b/searx/engines/sjp.pyindex 711fed736..639420095 100644--- a/searx/engines/sjp.py+++ b/searx/engines/sjp.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Słownik Języka PolskiegoDictionary of the polish language from PWN (sjp.pwn)diff --git a/searx/engines/solidtorrents.py b/searx/engines/solidtorrents.pyindex b853d9e25..3cad8e549 100644--- a/searx/engines/solidtorrents.py+++ b/searx/engines/solidtorrents.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""SolidTorrents+"""from datetime import datetimediff --git a/searx/engines/solr.py b/searx/engines/solr.pyindex 85ed42cf9..4b80d5729 100644--- a/searx/engines/solr.py+++ b/searx/engines/solr.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint""".. sidebar:: info- :origin:`solr.py <searx/engines/solr.py>`diff --git a/searx/engines/soundcloud.py b/searx/engines/soundcloud.pyindex 78947c69c..3181d39b7 100644--- a/searx/engines/soundcloud.py+++ b/searx/engines/soundcloud.py@@ -5,9 +5,9 @@import refrom json import loads+from urllib.parse import quote_plus, urlencodefrom lxml import htmlfrom dateutil import parser-from urllib.parse import quote_plus, urlencodefrom searx.network import get as http_get# about@@ -42,10 +42,10 @@ guest_client_id = ''def get_client_id():- response = http_get("https://soundcloud.com")+ resp = http_get("https://soundcloud.com")- if response.ok:- tree = html.fromstring(response.content)+ if resp.ok:+ tree = html.fromstring(resp.content)# script_tags has been moved from /assets/app/ to /assets/ path. I# found client_id in https://a-v2.sndcdn.com/assets/49-a0c01933-3.jsscript_tags = tree.xpath("//script[contains(@src, '/assets/')]")@@ -54,17 +54,17 @@ def get_client_id():# extracts valid app_js urls from soundcloud.com contentfor app_js_url in app_js_urls[::-1]:# gets app_js and searches for the clientid- response = http_get(app_js_url)- if response.ok:- cids = cid_re.search(response.content.decode())+ resp = http_get(app_js_url)+ if resp.ok:+ cids = cid_re.search(resp.content.decode())if cids is not None and len(cids.groups()):return cids.groups()[0]logger.warning("Unable to fetch guest client_id from SoundCloud, check parser!")return ""-def init(engine_settings=None):- global guest_client_id+def init(engine_settings=None): # pylint: disable=unused-argument+ global guest_client_id # pylint: disable=global-statement# api-keyguest_client_id = get_client_id()@@ -78,7 +78,6 @@ def request(query, params):return params-# get response from search-requestdef response(resp):results = []search_res = loads(resp.text)diff --git a/searx/engines/spotify.py b/searx/engines/spotify.pyindex 491a7058e..3b86328b7 100644--- a/searx/engines/spotify.py+++ b/searx/engines/spotify.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Spotify (Music)+"""Spotify (Music)+"""from json import loads@@ -60,13 +60,13 @@ def response(resp):for result in search_res.get('tracks', {}).get('items', {}):if result['type'] == 'track':title = result['name']- url = result['external_urls']['spotify']+ link = result['external_urls']['spotify']content = '{} - {} - {}'.format(result['artists'][0]['name'], result['album']['name'], result['name'])# append resultresults.append({- 'url': url,+ 'url': link,'title': title,'iframe_src': "https://embed.spotify.com/?uri=spotify:track:" + result['id'],'content': content,diff --git a/searx/engines/springer.py b/searx/engines/springer.pyindex a4d0832d8..ba59fa926 100644--- a/searx/engines/springer.py+++ b/searx/engines/springer.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Springer Nature (science)"""diff --git a/searx/engines/sqlite.py b/searx/engines/sqlite.pyindex 76e83af8a..f5f6ac8bf 100644--- a/searx/engines/sqlite.py+++ b/searx/engines/sqlite.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""SQLite is a small, fast and reliable SQL database engine. It does not requireany extra dependency.diff --git a/searx/engines/stackexchange.py b/searx/engines/stackexchange.pyindex 99615b1a7..02e0d477a 100644--- a/searx/engines/stackexchange.py+++ b/searx/engines/stackexchange.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Stack Exchange API v2.3* https://api.stackexchange.com/diff --git a/searx/engines/startpage.py b/searx/engines/startpage.pyindex 15ebc6d0b..aa594f0dc 100644--- a/searx/engines/startpage.py+++ b/searx/engines/startpage.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Startpage's language & region selectors are a mess .... _startpage regions:diff --git a/searx/engines/stract.py b/searx/engines/stract.pyindex c2497998f..2ba26e756 100644--- a/searx/engines/stract.py+++ b/searx/engines/stract.py@@ -1,7 +1,8 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint-"""Stract is an independent open source search engine.-At this state, it's still in beta and hence this implementation will need to be updated once beta ends.+"""Stract is an independent open source search engine. At this state, it's+still in beta and hence this implementation will need to be updated once beta+ends.+"""from json import dumpsdiff --git a/searx/engines/svgrepo.py b/searx/engines/svgrepo.pyindex 19c37ff58..156f4b2a8 100644--- a/searx/engines/svgrepo.py+++ b/searx/engines/svgrepo.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Svgrepo (images)"""diff --git a/searx/engines/tagesschau.py b/searx/engines/tagesschau.pyindex cfa184025..58bd40e56 100644--- a/searx/engines/tagesschau.py+++ b/searx/engines/tagesschau.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""ARD: `Tagesschau API`_The Tagesschau is a news program of the ARD. Via the `Tagesschau API`_, currentdiff --git a/searx/engines/tineye.py b/searx/engines/tineye.pyindex 6c5ff134c..196c89a2b 100644--- a/searx/engines/tineye.py+++ b/searx/engines/tineye.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This engine implements *Tineye - reverse image search*Using TinEye, you can search by image or perform what we call a reverse imagediff --git a/searx/engines/tokyotoshokan.py b/searx/engines/tokyotoshokan.pyindex b01de38c1..33f036428 100644--- a/searx/engines/tokyotoshokan.py+++ b/searx/engines/tokyotoshokan.py@@ -1,12 +1,13 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Tokyo Toshokan (A BitTorrent Library for Japanese Media)+"""Tokyo Toshokan (A BitTorrent Library for Japanese Media)+"""import re+from datetime import datetimefrom urllib.parse import urlencode+from lxml import html-from datetime import datetimefrom searx.utils import extract_text, get_torrent_size, int_or_zero# about@@ -75,14 +76,14 @@ def response(resp):# ('1.228', 'GB')groups = size_re.match(item).groups()params['filesize'] = get_torrent_size(groups[0], groups[1])- except:+ except: # pylint: disable=bare-exceptpasselif item.startswith('Date:'):try:# Date: 2016-02-21 21:44 UTCdate = datetime.strptime(item, 'Date: %Y-%m-%d %H:%M UTC')params['publishedDate'] = date- except:+ except: # pylint: disable=bare-exceptpasselif item.startswith('Comment:'):params['content'] = itemdiff --git a/searx/engines/tootfinder.py b/searx/engines/tootfinder.pyindex b754e15a5..806a7d688 100644--- a/searx/engines/tootfinder.py+++ b/searx/engines/tootfinder.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Tootfinder (social media)"""diff --git a/searx/engines/torznab.py b/searx/engines/torznab.pyindex 101cab9e3..70ba78ab4 100644--- a/searx/engines/torznab.py+++ b/searx/engines/torznab.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Torznab_ is an API specification that provides a standardized way to querytorrent site for content. It is used by a number of torrent applications,including Prowlarr_ and Jackett_.diff --git a/searx/engines/translated.py b/searx/engines/translated.pyindex 9900c017b..105a1d717 100644--- a/searx/engines/translated.py+++ b/searx/engines/translated.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- MyMemory Translated+"""MyMemory Translated+"""# about@@ -23,7 +23,7 @@ https_support = Trueapi_key = ''-def request(query, params):+def request(query, params): # pylint: disable=unused-argumentif api_key:key_form = '&key=' + api_keyelse:diff --git a/searx/engines/unsplash.py b/searx/engines/unsplash.pyindex 1967fefd2..998013f57 100644--- a/searx/engines/unsplash.py+++ b/searx/engines/unsplash.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Unsplash"""diff --git a/searx/engines/voidlinux.py b/searx/engines/voidlinux.pyindex 608402d13..0d807ace4 100644--- a/searx/engines/voidlinux.py+++ b/searx/engines/voidlinux.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""SearXNG engine for `Void Linux binary packages`_. Void is a general purposeoperating system, based on the monolithic Linux kernel. Its package systemallows you to quickly install, update and remove software; software is provideddiff --git a/searx/engines/wallhaven.py b/searx/engines/wallhaven.pyindex 94be1a6a7..127873d5d 100644--- a/searx/engines/wallhaven.py+++ b/searx/engines/wallhaven.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Wallhaven_ is a site created by and for people who like wallpapers... _Wallhaven: https://wallhaven.cc/about#Copyrightdiff --git a/searx/engines/wikicommons.py b/searx/engines/wikicommons.pyindex 9b0849716..0bb140abc 100644--- a/searx/engines/wikicommons.py+++ b/searx/engines/wikicommons.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Wikimedia Commons (images)"""diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.pyindex 8fa3a97d3..268da6fa9 100644--- a/searx/engines/wikidata.py+++ b/searx/engines/wikidata.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This module implements the Wikidata engine. Some implementations are sharedfrom :ref:`wikipedia engine`.diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.pyindex d825cbdea..187915d65 100644--- a/searx/engines/wikipedia.py+++ b/searx/engines/wikipedia.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""This module implements the Wikipedia engine. Some of this implementationsare shared by other engines:diff --git a/searx/engines/wolframalpha_api.py b/searx/engines/wolframalpha_api.pyindex 6a2423b51..5670e356f 100644--- a/searx/engines/wolframalpha_api.py+++ b/searx/engines/wolframalpha_api.py@@ -1,11 +1,12 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Wolfram|Alpha (Science)+"""Wolfram|Alpha (Science)+"""-from lxml import etreefrom urllib.parse import urlencode+from lxml import etree+# aboutabout = {"website": 'https://www.wolframalpha.com',@@ -79,7 +80,7 @@ def response(resp):try:infobox_title = search_results.xpath(input_xpath)[0].text- except:+ except: # pylint: disable=bare-exceptinfobox_title = ""pods = search_results.xpath(pods_xpath)diff --git a/searx/engines/wolframalpha_noapi.py b/searx/engines/wolframalpha_noapi.pyindex bad25602a..a9d177c32 100644--- a/searx/engines/wolframalpha_noapi.py+++ b/searx/engines/wolframalpha_noapi.py@@ -54,12 +54,12 @@ def obtain_token():token_response = http_get('https://www.wolframalpha.com/input/api/v1/code?ts=9999999999999999999', timeout=2.0)token['value'] = loads(token_response.text)['code']token['last_updated'] = update_time- except:+ except: # pylint: disable=bare-exceptpassreturn token-def init(engine_settings=None):+def init(engine_settings=None): # pylint: disable=unused-argumentobtain_token()@@ -83,7 +83,7 @@ def response(resp):if not resp_json['queryresult']['success']:return []- # TODO handle resp_json['queryresult']['assumptions']+ # handle resp_json['queryresult']['assumptions']?result_chunks = []infobox_title = ""result_content = ""diff --git a/searx/engines/wttr.py b/searx/engines/wttr.pyindex 2eaee62ae..11a2d27cc 100644--- a/searx/engines/wttr.py+++ b/searx/engines/wttr.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""wttr.in (weather forecast service)"""from json import loadsdiff --git a/searx/engines/www1x.py b/searx/engines/www1x.pyindex a7ec06f18..0d4b6b799 100644--- a/searx/engines/www1x.py+++ b/searx/engines/www1x.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""1x (Images)"""diff --git a/searx/engines/xpath.py b/searx/engines/xpath.pyindex 442e90595..bdad7e753 100644--- a/searx/engines/xpath.py+++ b/searx/engines/xpath.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""The XPath engine is a *generic* engine with which it is possible to configureengines in the settings.diff --git a/searx/engines/yacy.py b/searx/engines/yacy.pyindex 50c7886c0..3a0414787 100644--- a/searx/engines/yacy.py+++ b/searx/engines/yacy.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""YaCy_ is a free distributed search engine, built on the principles ofpeer-to-peer (P2P) networks.diff --git a/searx/engines/yahoo.py b/searx/engines/yahoo.pyindex 53dc6f806..d5edde212 100644--- a/searx/engines/yahoo.py+++ b/searx/engines/yahoo.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Yahoo Search (Web)Languages are supported by mapping the language to a domain. If domain is notdiff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.pyindex 00f208b17..f3f756ba3 100644--- a/searx/engines/yahoo_news.py+++ b/searx/engines/yahoo_news.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Yahoo (News)Yahoo News is "English only" and do not offer localized nor language queries.diff --git a/searx/engines/yandex_music.py b/searx/engines/yandex_music.pyindex 5d6fe6bb1..810654b6f 100644--- a/searx/engines/yandex_music.py+++ b/searx/engines/yandex_music.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Yandex Music.. _Countries where Yandex.Music is available: https://yandex.com/support/music/access.htmldiff --git a/searx/engines/yep.py b/searx/engines/yep.pyindex c3cb65c7b..e01e31c8c 100644--- a/searx/engines/yep.py+++ b/searx/engines/yep.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Yep (general, images, news)"""diff --git a/searx/engines/youtube_api.py b/searx/engines/youtube_api.pyindex 1b332a9f7..25ad2cb04 100644--- a/searx/engines/youtube_api.py+++ b/searx/engines/youtube_api.py@@ -4,8 +4,9 @@"""from json import loads-from dateutil import parserfrom urllib.parse import urlencode++from dateutil import parserfrom searx.exceptions import SearxEngineAPIException# aboutdiff --git a/searx/engines/youtube_noapi.py b/searx/engines/youtube_noapi.pyindex 7992adf82..b015dff8d 100644--- a/searx/engines/youtube_noapi.py+++ b/searx/engines/youtube_noapi.py@@ -1,6 +1,6 @@# SPDX-License-Identifier: AGPL-3.0-or-later-"""- Youtube (Videos)+"""Youtube (Videos)+"""from functools import reduce@@ -101,7 +101,7 @@ def parse_next_page_response(response_text):"key": "next_page_token",})- except:+ except: # pylint: disable=bare-exceptpassreturn results@@ -167,5 +167,4 @@ def parse_first_page_response(response_text):def get_text_from_json(element):if 'runs' in element:return reduce(lambda a, b: a + b.get('text', ''), element.get('runs'), '')- else:- return element.get('simpleText', '')+ return element.get('simpleText', '')diff --git a/searx/engines/yummly.py b/searx/engines/yummly.pyindex 25285ef7c..fcafcc651 100644--- a/searx/engines/yummly.py+++ b/searx/engines/yummly.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""Yummly"""diff --git a/searx/engines/zlibrary.py b/searx/engines/zlibrary.pyindex dd32004f7..ba1f474fa 100644--- a/searx/engines/zlibrary.py+++ b/searx/engines/zlibrary.py@@ -1,5 +1,4 @@# SPDX-License-Identifier: AGPL-3.0-or-later-# lint: pylint"""`Z-Library`_ (abbreviated as z-lib, formerly BookFinder) is a shadow libraryproject for file-sharing access to scholarly journal articles, academic textsand general-interest books. It began as a mirror of Library Genesis, from whichdiff --git a/utils/lib_sxng_test.sh b/utils/lib_sxng_test.shold mode 100644new mode 100755index 41a20d86f..1bba9aa4c--- a/utils/lib_sxng_test.sh+++ b/utils/lib_sxng_test.sh@@ -1,3 +1,8 @@+#!/usr/bin/env bash+# SPDX-License-Identifier: AGPL-3.0-or-later++[[ -z "${PYLINT_OPTIONS}" ]] && PYLINT_OPTIONS="-j 0 --rcfile .pylintrc"+test.help(){cat <<EOFtest.:@@ -22,20 +27,19 @@ test.yamllint() {test.pylint() {# shellcheck disable=SC2086( set -e- build_msg TEST "[pylint] \$PYLINT_FILES"pyenv.activate- python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \- --additional-builtins="${PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES}" \++ build_msg TEST "[pylint] \$PYLINT_FILES"+ pylint ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \"${PYLINT_FILES[@]}"build_msg TEST "[pylint] searx/engines"- python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \- --disable="${PYLINT_SEARXNG_DISABLE_OPTION}" \- --additional-builtins="${PYLINT_ADDITIONAL_BUILTINS_FOR_ENGINES}" \+ pylint ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \+ --additional-builtins="traits,supported_languages,language_aliases,logger,categories" \searx/enginesbuild_msg TEST "[pylint] searx tests"- python ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \+ pylint ${PYLINT_OPTIONS} ${PYLINT_VERBOSE} \--disable="${PYLINT_SEARXNG_DISABLE_OPTION}" \--ignore=searx/engines \searx tests