diff options
| -rw-r--r-- | .github/ISSUE_TEMPLATE/bug-report.md | 37 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/config.yml | 14 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/engine-request.md | 29 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/feature-request.md | 19 | ||||
| -rw-r--r-- | docs/dev/engine_overview.rst | 7 | ||||
| -rw-r--r-- | searx/engines/wikidata.py | 2 | ||||
| -rw-r--r-- | searx/engines/wikipedia.py | 4 | ||||
| -rw-r--r-- | searx/search.py | 6 |
8 files changed, 111 insertions, 7 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 000000000..67627835d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,37 @@ +--- +name: Bug report +about: Report a bug in Searx +title: '' +labels: bug +assignees: '' + +--- +**Version of Searx, commit number if you are using on master branch and stipulate if you forked Searx** +<!-- If you are running on master branch using git execute this command +in order to fetch the latest commit ID: +``` +git log -1 +``` +If you are using searx-docker then look at the bottom of the Searx page +and check for the version after "Powered by searx" + +Please also stipulate if you are using a forked version of Searx and +include a link to the fork source code. +--> +**How did you install Searx?** +<!-- Did you install Searx using the official wiki or using searx-docker +or manually by executing the searx/webapp.py file? --> +**What happened?** +<!-- A clear and concise description of what the bug is. --> + +**How To Reproduce** +<!-- How can we reproduce this issue? (as minimally and as precisely as possible) --> + +**Expected behavior** +<!-- A clear and concise description of what you expected to happen. --> + +**Screenshots & Logs** +<!-- If applicable, add screenshots, logs to help explain your problem. --> + +**Additional context** +<!-- Add any other context about the problem here. -->
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..617d81d6d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: true +contact_links: + - name: Installation issue using the official wiki + url: https://github.com/searx/searx/discussions/new?category_id=32001257 + about: Ask for help if you are having some issue with installing Searx using the official wiki. + - name: Installation issue using searx-docker + url: https://github.com/searx/searx/discussions/new?category_id=32001259 + about: Ask for help if you are having some issue with installing Searx using searx-docker. + - name: Installation issue without using the official wiki nor searx-docker + url: https://github.com/searx/searx/discussions/new?category_id=32001260 + about: Ask for help if you are having some issue with installing Searx manually without using the wiki nor searx-docker. + - name: Report a bug on a public Searx instance + url: https://github.com/searx/searx/discussions/new?category_id=32001412 + about: Report a bug that you discovered on a public Searx instance.
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/engine-request.md b/.github/ISSUE_TEMPLATE/engine-request.md new file mode 100644 index 000000000..1037004d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/engine-request.md @@ -0,0 +1,29 @@ +--- +name: Engine request +about: Request a new engine in Searx +title: '' +labels: enhancement, engine request +assignees: '' + +--- +**Working URL to the engine** +<!-- Please check if the engine is responding correctly before submitting it. --> + +**Why do you want to add this engine?** +<!-- What's special about this engine? Is it open source or libre? --> + +**Features of this engine** +<!-- Features of this engine: Doesn't track its users, fast, easy to integrate, ... --> + +**How can Searx fetch the information from this engine?** +<!-- List API URL, example code (using the correct markdown) and more +that could be useful for the developers in order to implement this engine. +If you don't know what to write, let this part blank.> + +**Applicable category of this engine** +<!-- Where should this new engine fit in Searx? Current categories in Searx: +general, files, images, it, map, music, news, science, social media and videos. +You can add multiple categories at the same time. --> + +**Additional context** +<!-- Add any other context about this engine here. -->
\ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000..3bb27fefd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Request a new feature in Searx +title: '' +labels: enhancement +assignees: '' + +--- +**Is your feature request related to a problem? Please describe.** +<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] --> + +**Describe the solution you'd like** +<!-- A clear and concise description of what you want to happen. --> + +**Describe alternatives you've considered** +<!-- A clear and concise description of any alternative solutions or features you've considered. --> + +**Additional context** +<!-- Add any other context or screenshots about the feature request here. -->
\ No newline at end of file diff --git a/docs/dev/engine_overview.rst b/docs/dev/engine_overview.rst index b9f5fcbbf..99726a456 100644 --- a/docs/dev/engine_overview.rst +++ b/docs/dev/engine_overview.rst @@ -134,9 +134,9 @@ The function ``def request(query, params):`` always returns the ``params`` variable. Inside searx, the following paramters can be used to specify a search request: -================== =========== ======================================================================== +================== =========== ========================================================================== argument type information -================== =========== ======================================================================== +================== =========== ========================================================================== url string requested url method string HTTP request method headers set HTTP header information @@ -145,7 +145,8 @@ cookies set HTTP cookies verify boolean Performing SSL-Validity check max_redirects int maximum redirects, hard limit soft_max_redirects int maximum redirects, soft limit. Record an error but don't stop the engine -================== =========== ======================================================================== +raise_for_status bool True by default: raise an exception if the HTTP code of response is >= 300 +================== =========== ========================================================================== example code diff --git a/searx/engines/wikidata.py b/searx/engines/wikidata.py index 539ce5ad4..60d0dc9a0 100644 --- a/searx/engines/wikidata.py +++ b/searx/engines/wikidata.py @@ -190,7 +190,7 @@ def get_results(attribute_result, attributes, language): infobox_id_lang = None infobox_urls = [] infobox_attributes = [] - infobox_content = attribute_result.get('itemDescription') + infobox_content = attribute_result.get('itemDescription', []) img_src = None img_src_priority = 100 diff --git a/searx/engines/wikipedia.py b/searx/engines/wikipedia.py index 620ec3c14..9fce170eb 100644 --- a/searx/engines/wikipedia.py +++ b/searx/engines/wikipedia.py @@ -37,13 +37,15 @@ def request(query, params): language=url_lang(params['language'])) params['headers']['User-Agent'] = searx_useragent() + params['raise_for_status'] = False + params['soft_max_redirects'] = 2 return params # get response from search-request def response(resp): - if not resp.ok: + if resp.status_code == 404: return [] results = [] diff --git a/searx/search.py b/searx/search.py index 8898f1576..8c2ad8d72 100644 --- a/searx/search.py +++ b/searx/search.py @@ -143,7 +143,8 @@ def send_http_request(engine, request_params): response = req(request_params['url'], **request_args) # check HTTP status - response.raise_for_status() + if request_params.get('raise_for_status'): + response.raise_for_status() # check soft limit of the redirect count if len(response.history) > soft_max_redirects: @@ -340,7 +341,8 @@ def default_request_params(): 'url': '', 'cookies': {}, 'verify': True, - 'auth': None + 'auth': None, + 'raise_for_status': True } |