We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bug: bilibili engine is broken
<!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->

Something has changed, and now some fixes are needed to use the api successfully.

**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**
Repository: https://github.com/searxng/searxng
Branch: master
Version: 2023.9.27+1a66d7467+dirty
<!-- 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 searxng-docker then look at the bottom of the SearXNG page
and check for the version after "Powered by SearXNG"

Please also stipulate if you are using a forked version of SearXNG and
include a link to the fork source code.
-->
**How did you install SearXNG?**
make run
<!-- Did you install SearXNG using the official wiki or using searxng-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. -->


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `searx/engines/bilibili.py`
Content:
```
1 # SPDX-License-Identifier: AGPL-3.0-or-later
2 # lint: pylint
3 """Bilibili is a Chinese video sharing website.
4 
5 .. _Bilibili: https://www.bilibili.com
6 """
7 
8 import random
9 import string
10 from urllib.parse import urlencode
11 from datetime import datetime, timedelta
12 
13 # Engine metadata
14 about = {
15     "website": "https://www.bilibili.com",
16     "wikidata_id": "Q3077586",
17     "official_api_documentation": None,
18     "use_official_api": False,
19     "require_api_key": False,
20     "results": "JSON",
21 }
22 
23 # Engine configuration
24 paging = True
25 results_per_page = 20
26 categories = ["videos"]
27 
28 # Search URL
29 base_url = "https://api.bilibili.com/x/web-interface/wbi/search/type"
30 
31 cookie = {
32     "innersign": "0",
33     "buvid3": "".join(random.choice(string.hexdigits) for _ in range(16)) + "infoc",
34     "i-wanna-go-back": "-1",
35     "b_ut": "7",
36     "FEED_LIVE_VERSION": "V8",
37     "header_theme_version": "undefined",
38     "home_feed_column": "4",
39 }
40 
41 
42 def request(query, params):
43     query_params = {
44         "__refresh__": "true",
45         "page": params["pageno"],
46         "page_size": results_per_page,
47         "single_column": "0",
48         "keyword": query,
49         "search_type": "video",
50     }
51 
52     params["url"] = f"{base_url}?{urlencode(query_params)}"
53     params["cookies"] = cookie
54 
55     return params
56 
57 
58 # Format the video duration
59 def format_duration(duration):
60     minutes, seconds = map(int, duration.split(":"))
61     total_seconds = minutes * 60 + seconds
62 
63     formatted_duration = str(timedelta(seconds=total_seconds))[2:] if 0 <= total_seconds < 3600 else ""
64 
65     return formatted_duration
66 
67 
68 def response(resp):
69     search_res = resp.json()
70 
71     results = []
72 
73     for item in search_res.get("data", {}).get("result", []):
74         title = item["title"]
75         url = item["arcurl"]
76         thumbnail = item["pic"]
77         description = item["description"]
78         author = item["author"]
79         video_id = item["aid"]
80         unix_date = item["pubdate"]
81 
82         formatted_date = datetime.utcfromtimestamp(unix_date)
83         formatted_duration = format_duration(item["duration"])
84         iframe_url = f"https://player.bilibili.com/player.html?aid={video_id}&high_quality=1&autoplay=false&danmaku=0"
85 
86         results.append(
87             {
88                 "title": title,
89                 "url": url,
90                 "content": description,
91                 "author": author,
92                 "publishedDate": formatted_date,
93                 "length": formatted_duration,
94                 "thumbnail": thumbnail,
95                 "iframe_src": iframe_url,
96                 "template": "videos.html",
97             }
98         )
99 
100     return results
101
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/searx/engines/bilibili.py b/searx/engines/bilibili.py
--- a/searx/engines/bilibili.py
+++ b/searx/engines/bilibili.py
@@ -26,7 +26,7 @@
 categories = ["videos"]
 
 # Search URL
-base_url = "https://api.bilibili.com/x/web-interface/wbi/search/type"
+base_url = "https://api.bilibili.com/x/web-interface/search/type"
 
 cookie = {
     "innersign": "0",

{"golden_diff": "diff --git a/searx/engines/bilibili.py b/searx/engines/bilibili.py\n--- a/searx/engines/bilibili.py\n+++ b/searx/engines/bilibili.py\n@@ -26,7 +26,7 @@\n categories = [\"videos\"]\n \n # Search URL\n-base_url = \"https://api.bilibili.com/x/web-interface/wbi/search/type\"\n+base_url = \"https://api.bilibili.com/x/web-interface/search/type\"\n \n cookie = {\n     \"innersign\": \"0\",\n", "issue": "Bug: bilibili engine is broken\n<!-- PLEASE FILL THESE FIELDS, IT REALLY HELPS THE MAINTAINERS OF SearXNG -->\r\n\r\nSomething has changed, and now some fixes are needed to use the api successfully.\r\n\r\n**Version of SearXNG, commit number if you are using on master branch and stipulate if you forked SearXNG**\r\nRepository: https://github.com/searxng/searxng\r\nBranch: master\r\nVersion: 2023.9.27+1a66d7467+dirty\r\n<!-- If you are running on master branch using git execute this command\r\nin order to fetch the latest commit ID:\r\n```\r\ngit log -1\r\n``` \r\nIf you are using searxng-docker then look at the bottom of the SearXNG page\r\nand check for the version after \"Powered by SearXNG\"\r\n\r\nPlease also stipulate if you are using a forked version of SearXNG and\r\ninclude a link to the fork source code.\r\n-->\r\n**How did you install SearXNG?**\r\nmake run\r\n<!-- Did you install SearXNG using the official wiki or using searxng-docker\r\nor manually by executing the searx/webapp.py file? -->\r\n**What happened?**\r\n<!-- A clear and concise description of what the bug is. -->\r\n\r\n**How To Reproduce**\r\n<!-- How can we reproduce this issue? (as minimally and as precisely as possible) -->\r\n\r\n**Expected behavior**\r\n<!-- A clear and concise description of what you expected to happen. -->\r\n\r\n**Screenshots & Logs**\r\n<!-- If applicable, add screenshots, logs to help explain your problem. -->\r\n\r\n**Additional context**\r\n<!-- Add any other context about the problem here. -->\r\n\n", "before_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"Bilibili is a Chinese video sharing website.\n\n.. _Bilibili: https://www.bilibili.com\n\"\"\"\n\nimport random\nimport string\nfrom urllib.parse import urlencode\nfrom datetime import datetime, timedelta\n\n# Engine metadata\nabout = {\n    \"website\": \"https://www.bilibili.com\",\n    \"wikidata_id\": \"Q3077586\",\n    \"official_api_documentation\": None,\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": \"JSON\",\n}\n\n# Engine configuration\npaging = True\nresults_per_page = 20\ncategories = [\"videos\"]\n\n# Search URL\nbase_url = \"https://api.bilibili.com/x/web-interface/wbi/search/type\"\n\ncookie = {\n    \"innersign\": \"0\",\n    \"buvid3\": \"\".join(random.choice(string.hexdigits) for _ in range(16)) + \"infoc\",\n    \"i-wanna-go-back\": \"-1\",\n    \"b_ut\": \"7\",\n    \"FEED_LIVE_VERSION\": \"V8\",\n    \"header_theme_version\": \"undefined\",\n    \"home_feed_column\": \"4\",\n}\n\n\ndef request(query, params):\n    query_params = {\n        \"__refresh__\": \"true\",\n        \"page\": params[\"pageno\"],\n        \"page_size\": results_per_page,\n        \"single_column\": \"0\",\n        \"keyword\": query,\n        \"search_type\": \"video\",\n    }\n\n    params[\"url\"] = f\"{base_url}?{urlencode(query_params)}\"\n    params[\"cookies\"] = cookie\n\n    return params\n\n\n# Format the video duration\ndef format_duration(duration):\n    minutes, seconds = map(int, duration.split(\":\"))\n    total_seconds = minutes * 60 + seconds\n\n    formatted_duration = str(timedelta(seconds=total_seconds))[2:] if 0 <= total_seconds < 3600 else \"\"\n\n    return formatted_duration\n\n\ndef response(resp):\n    search_res = resp.json()\n\n    results = []\n\n    for item in search_res.get(\"data\", {}).get(\"result\", []):\n        title = item[\"title\"]\n        url = item[\"arcurl\"]\n        thumbnail = item[\"pic\"]\n        description = item[\"description\"]\n        author = item[\"author\"]\n        video_id = item[\"aid\"]\n        unix_date = item[\"pubdate\"]\n\n        formatted_date = datetime.utcfromtimestamp(unix_date)\n        formatted_duration = format_duration(item[\"duration\"])\n        iframe_url = f\"https://player.bilibili.com/player.html?aid={video_id}&high_quality=1&autoplay=false&danmaku=0\"\n\n        results.append(\n            {\n                \"title\": title,\n                \"url\": url,\n                \"content\": description,\n                \"author\": author,\n                \"publishedDate\": formatted_date,\n                \"length\": formatted_duration,\n                \"thumbnail\": thumbnail,\n                \"iframe_src\": iframe_url,\n                \"template\": \"videos.html\",\n            }\n        )\n\n    return results\n", "path": "searx/engines/bilibili.py"}], "after_files": [{"content": "# SPDX-License-Identifier: AGPL-3.0-or-later\n# lint: pylint\n\"\"\"Bilibili is a Chinese video sharing website.\n\n.. _Bilibili: https://www.bilibili.com\n\"\"\"\n\nimport random\nimport string\nfrom urllib.parse import urlencode\nfrom datetime import datetime, timedelta\n\n# Engine metadata\nabout = {\n    \"website\": \"https://www.bilibili.com\",\n    \"wikidata_id\": \"Q3077586\",\n    \"official_api_documentation\": None,\n    \"use_official_api\": False,\n    \"require_api_key\": False,\n    \"results\": \"JSON\",\n}\n\n# Engine configuration\npaging = True\nresults_per_page = 20\ncategories = [\"videos\"]\n\n# Search URL\nbase_url = \"https://api.bilibili.com/x/web-interface/search/type\"\n\ncookie = {\n    \"innersign\": \"0\",\n    \"buvid3\": \"\".join(random.choice(string.hexdigits) for _ in range(16)) + \"infoc\",\n    \"i-wanna-go-back\": \"-1\",\n    \"b_ut\": \"7\",\n    \"FEED_LIVE_VERSION\": \"V8\",\n    \"header_theme_version\": \"undefined\",\n    \"home_feed_column\": \"4\",\n}\n\n\ndef request(query, params):\n    query_params = {\n        \"__refresh__\": \"true\",\n        \"page\": params[\"pageno\"],\n        \"page_size\": results_per_page,\n        \"single_column\": \"0\",\n        \"keyword\": query,\n        \"search_type\": \"video\",\n    }\n\n    params[\"url\"] = f\"{base_url}?{urlencode(query_params)}\"\n    params[\"cookies\"] = cookie\n\n    return params\n\n\n# Format the video duration\ndef format_duration(duration):\n    minutes, seconds = map(int, duration.split(\":\"))\n    total_seconds = minutes * 60 + seconds\n\n    formatted_duration = str(timedelta(seconds=total_seconds))[2:] if 0 <= total_seconds < 3600 else \"\"\n\n    return formatted_duration\n\n\ndef response(resp):\n    search_res = resp.json()\n\n    results = []\n\n    for item in search_res.get(\"data\", {}).get(\"result\", []):\n        title = item[\"title\"]\n        url = item[\"arcurl\"]\n        thumbnail = item[\"pic\"]\n        description = item[\"description\"]\n        author = item[\"author\"]\n        video_id = item[\"aid\"]\n        unix_date = item[\"pubdate\"]\n\n        formatted_date = datetime.utcfromtimestamp(unix_date)\n        formatted_duration = format_duration(item[\"duration\"])\n        iframe_url = f\"https://player.bilibili.com/player.html?aid={video_id}&high_quality=1&autoplay=false&danmaku=0\"\n\n        results.append(\n            {\n                \"title\": title,\n                \"url\": url,\n                \"content\": description,\n                \"author\": author,\n                \"publishedDate\": formatted_date,\n                \"length\": formatted_duration,\n                \"thumbnail\": thumbnail,\n                \"iframe_src\": iframe_url,\n                \"template\": \"videos.html\",\n            }\n        )\n\n    return results\n", "path": "searx/engines/bilibili.py"}]}