prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Bug: engine "archive is" reports HTTP 404 / Not found
  **Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
  
  1970d28a
  
  **Technical report**
  
  Error
    * Error: httpx.HTTPStatusError
    * Percentage: 100
    * Parameters: `('404', 'Not Found', 'archive.is')`
    * File name: `searx/search/processors/online.py:99`
    * Function: `_send_http_request`
    * Code: `response = req(params['url'], **request_args)`
  
  
  
  </issue>
  <code>
  [start of searx/engines/xpath.py]
  1 # SPDX-License-Identifier: AGPL-3.0-or-later
  2 
  3 from lxml import html
  4 from urllib.parse import urlencode
  5 from searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list
  6 
  7 search_url = None
  8 url_xpath = None
  9 content_xpath = None
  10 title_xpath = None
  11 thumbnail_xpath = False
  12 paging = False
  13 suggestion_xpath = ''
  14 results_xpath = ''
  15 cached_xpath = ''
  16 cached_url = ''
  17 
  18 # parameters for engines with paging support
  19 #
  20 # number of results on each page
  21 # (only needed if the site requires not a page number, but an offset)
  22 page_size = 1
  23 # number of the first page (usually 0 or 1)
  24 first_page_num = 1
  25 
  26 
  27 def request(query, params):
  28     query = urlencode({'q': query})[2:]
  29 
  30     fp = {'query': query}
  31     if paging and search_url.find('{pageno}') >= 0:
  32         fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num
  33 
  34     params['url'] = search_url.format(**fp)
  35     params['query'] = query
  36 
  37     return params
  38 
  39 
  40 def response(resp):
  41     results = []
  42     dom = html.fromstring(resp.text)
  43     is_onion = True if 'onions' in categories else False  # pylint: disable=undefined-variable
  44 
  45     if results_xpath:
  46         for result in eval_xpath_list(dom, results_xpath):
  47             url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)
  48             title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))
  49             content = extract_text(eval_xpath_list(result, content_xpath, min_len=1))
  50             tmp_result = {'url': url, 'title': title, 'content': content}
  51 
  52             # add thumbnail if available
  53             if thumbnail_xpath:
  54                 thumbnail_xpath_result = eval_xpath_list(result, thumbnail_xpath)
  55                 if len(thumbnail_xpath_result) > 0:
  56                     tmp_result['img_src'] = extract_url(thumbnail_xpath_result, search_url)
  57 
  58             # add alternative cached url if available
  59             if cached_xpath:
  60                 tmp_result['cached_url'] = cached_url\
  61                     + extract_text(eval_xpath_list(result, cached_xpath, min_len=1))
  62 
  63             if is_onion:
  64                 tmp_result['is_onion'] = True
  65 
  66             results.append(tmp_result)
  67     else:
  68         if cached_xpath:
  69             for url, title, content, cached in zip(
  70                 (extract_url(x, search_url) for
  71                  x in eval_xpath_list(dom, url_xpath)),
  72                 map(extract_text, eval_xpath_list(dom, title_xpath)),
  73                 map(extract_text, eval_xpath_list(dom, content_xpath)),
  74                 map(extract_text, eval_xpath_list(dom, cached_xpath))
  75             ):
  76                 results.append({'url': url, 'title': title, 'content': content,
  77                                 'cached_url': cached_url + cached, 'is_onion': is_onion})
  78         else:
  79             for url, title, content in zip(
  80                 (extract_url(x, search_url) for
  81                  x in eval_xpath_list(dom, url_xpath)),
  82                 map(extract_text, eval_xpath_list(dom, title_xpath)),
  83                 map(extract_text, eval_xpath_list(dom, content_xpath))
  84             ):
  85                 results.append({'url': url, 'title': title, 'content': content, 'is_onion': is_onion})
  86 
  87     if not suggestion_xpath:
  88         return results
  89     for suggestion in eval_xpath(dom, suggestion_xpath):
  90         results.append({'suggestion': extract_text(suggestion)})
  91     return results
  92
  [end of searx/engines/xpath.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py
  --- a/searx/engines/xpath.py
  +++ b/searx/engines/xpath.py
  @@ -14,6 +14,7 @@
   results_xpath = ''
   cached_xpath = ''
   cached_url = ''
  +soft_max_redirects = 0
   
   # parameters for engines with paging support
   #
  @@ -33,6 +34,7 @@
   
       params['url'] = search_url.format(**fp)
       params['query'] = query
  +    params['soft_max_redirects'] = soft_max_redirects
   
       return params
  
verification_info: {"golden_diff": "diff --git a/searx/engines/xpath.py b/searx/engines/xpath.py\n--- a/searx/engines/xpath.py\n+++ b/searx/engines/xpath.py\n@@ -14,6 +14,7 @@\n results_xpath = ''\n cached_xpath = ''\n cached_url = ''\n+soft_max_redirects = 0\n \n # parameters for engines with paging support\n #\n@@ -33,6 +34,7 @@\n \n     params['url'] = search_url.format(**fp)\n     params['query'] = query\n+    params['soft_max_redirects'] = soft_max_redirects\n \n     return params\n", "issue": "Bug: engine \"archive is\" reports HTTP 404 / Not found\n**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**\r\n\r\n1970d28a\r\n\r\n**Technical report**\r\n\r\nError\r\n  * Error: httpx.HTTPStatusError\r\n  * Percentage: 100\r\n  * Parameters: `('404', 'Not Found', 'archive.is')`\r\n  * File name: `searx/search/processors/online.py:99`\r\n  * Function: `_send_http_request`\r\n  * Code: `response = req(params['url'], **request_args)`\r\n\r\n\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n\nfrom lxml import html\nfrom urllib.parse import urlencode\nfrom searx.utils import extract_text, extract_url, eval_xpath, eval_xpath_list\n\nsearch_url = None\nurl_xpath = None\ncontent_xpath = None\ntitle_xpath = None\nthumbnail_xpath = False\npaging = False\nsuggestion_xpath = ''\nresults_xpath = ''\ncached_xpath = ''\ncached_url = ''\n\n# parameters for engines with paging support\n#\n# number of results on each page\n# (only needed if the site requires not a page number, but an offset)\npage_size = 1\n# number of the first page (usually 0 or 1)\nfirst_page_num = 1\n\n\ndef request(query, params):\n    query = urlencode({'q': query})[2:]\n\n    fp = {'query': query}\n    if paging and search_url.find('{pageno}') >= 0:\n        fp['pageno'] = (params['pageno'] - 1) * page_size + first_page_num\n\n    params['url'] = search_url.format(**fp)\n    params['query'] = query\n\n    return params\n\n\ndef response(resp):\n    results = []\n    dom = html.fromstring(resp.text)\n    is_onion = True if 'onions' in categories else False  # pylint: disable=undefined-variable\n\n    if results_xpath:\n        for result in eval_xpath_list(dom, results_xpath):\n            url = extract_url(eval_xpath_list(result, url_xpath, min_len=1), search_url)\n            title = extract_text(eval_xpath_list(result, title_xpath, min_len=1))\n            content = extract_text(eval_xpath_list(result, content_xpath, min_len=1))\n            tmp_result = {'url': url, 'title': title, 'content': content}\n\n            # add thumbnail if available\n            if thumbnail_xpath:\n                thumbnail_xpath_result = eval_xpath_list(result, thumbnail_xpath)\n                if len(thumbnail_xpath_result) > 0:\n                    tmp_result['img_src'] = extract_url(thumbnail_xpath_result, search_url)\n\n            # add alternative cached url if available\n            if cached_xpath:\n                tmp_result['cached_url'] = cached_url\\\n                    + extract_text(eval_xpath_list(result, cached_xpath, min_len=1))\n\n            if is_onion:\n                tmp_result['is_onion'] = True\n\n            results.append(tmp_result)\n    else:\n        if cached_xpath:\n            for url, title, content, cached in zip(\n                (extract_url(x, search_url) for\n                 x in eval_xpath_list(dom, url_xpath)),\n                map(extract_text, eval_xpath_list(dom, title_xpath)),\n                map(extract_text, eval_xpath_list(dom, content_xpath)),\n                map(extract_text, eval_xpath_list(dom, cached_xpath))\n            ):\n                results.append({'url': url, 'title': title, 'content': content,\n                                'cached_url': cached_url + cached, 'is_onion': is_onion})\n        else:\n            for url, title, content in zip(\n                (extract_url(x, search_url) for\n                 x in eval_xpath_list(dom, url_xpath)),\n                map(extract_text, eval_xpath_list(dom, title_xpath)),\n                map(extract_text, eval_xpath_list(dom, content_xpath))\n            ):\n                results.append({'url': url, 'title': title, 'content': content, 'is_onion': is_onion})\n\n    if not suggestion_xpath:\n        return results\n    for suggestion in eval_xpath(dom, suggestion_xpath):\n        results.append({'suggestion': extract_text(suggestion)})\n    return results\n", "path": "searx/engines/xpath.py"}]}