We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Bing Video search engine doesn't work
Hallo,

yesterday I've set up my own instance of searx. Thereby I discovered A problem with the Bing Video search engine. This is the shown error message:

```
Die folgenden Suchmaschinen können die Ergebnisse nicht empfangen:
bing videos (unexpected crash: list index out of range)
```

--- 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/bing_videos.py`
Content:
```
1 """
2  Bing (Videos)
3 
4  @website     https://www.bing.com/videos
5  @provide-api yes (http://datamarket.azure.com/dataset/bing/search)
6 
7  @using-api   no
8  @results     HTML
9  @stable      no
10  @parse       url, title, content, thumbnail
11 """
12 
13 from json import loads
14 from lxml import html
15 from searx.engines.bing_images import _fetch_supported_languages, supported_languages_url, get_region_code
16 from searx.engines.xpath import extract_text
17 from searx.url_utils import urlencode
18 
19 
20 categories = ['videos']
21 paging = True
22 safesearch = True
23 time_range_support = True
24 number_of_results = 10
25 language_support = True
26 
27 search_url = 'https://www.bing.com/videos/asyncv2?{query}&async=content&'\
28              'first={offset}&count={number_of_results}&CW=1366&CH=25&FORM=R5VR5'
29 time_range_string = '&qft=+filterui:videoage-lt{interval}'
30 time_range_dict = {'day': '1440',
31                    'week': '10080',
32                    'month': '43200',
33                    'year': '525600'}
34 
35 # safesearch definitions
36 safesearch_types = {2: 'STRICT',
37                     1: 'DEMOTE',
38                     0: 'OFF'}
39 
40 
41 # do search-request
42 def request(query, params):
43     offset = (params['pageno'] - 1) * 10 + 1
44 
45     # safesearch cookie
46     params['cookies']['SRCHHPGUSR'] = \
47         'ADLT=' + safesearch_types.get(params['safesearch'], 'DEMOTE')
48 
49     # language cookie
50     region = get_region_code(params['language'], lang_list=supported_languages)
51     params['cookies']['_EDGE_S'] = 'mkt=' + region + '&F=1'
52 
53     # query and paging
54     params['url'] = search_url.format(query=urlencode({'q': query}),
55                                       offset=offset,
56                                       number_of_results=number_of_results)
57 
58     # time range
59     if params['time_range'] in time_range_dict:
60         params['url'] += time_range_string.format(interval=time_range_dict[params['time_range']])
61 
62     return params
63 
64 
65 # get response from search-request
66 def response(resp):
67     results = []
68 
69     dom = html.fromstring(resp.text)
70 
71     for result in dom.xpath('//div[@class="dg_u"]'):
72 
73         # try to extract the url
74         url_container = result.xpath('.//div[@class="sa_wrapper"]/@data-eventpayload')
75         if len(url_container) > 0:
76             url = loads(url_container[0])['purl']
77         else:
78             url = result.xpath('./a/@href')[0]
79 
80             # discard results that do not return an external url
81             # very recent results sometimes don't return the video's url
82             if url.startswith('/videos/search?'):
83                 continue
84 
85         title = extract_text(result.xpath('./a//div[@class="tl"]'))
86         content = extract_text(result.xpath('.//div[@class="pubInfo"]'))
87         thumbnail = result.xpath('.//div[@class="vthumb"]/img/@src')[0]
88 
89         results.append({'url': url,
90                         'title': title,
91                         'content': content,
92                         'thumbnail': thumbnail,
93                         'template': 'videos.html'})
94 
95         # first page ignores requested number of results
96         if len(results) >= number_of_results:
97             break
98 
99     return results
100
```
--- 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/bing_videos.py b/searx/engines/bing_videos.py
--- a/searx/engines/bing_videos.py
+++ b/searx/engines/bing_videos.py
@@ -69,22 +69,11 @@
     dom = html.fromstring(resp.text)
 
     for result in dom.xpath('//div[@class="dg_u"]'):
-
-        # try to extract the url
-        url_container = result.xpath('.//div[@class="sa_wrapper"]/@data-eventpayload')
-        if len(url_container) > 0:
-            url = loads(url_container[0])['purl']
-        else:
-            url = result.xpath('./a/@href')[0]
-
-            # discard results that do not return an external url
-            # very recent results sometimes don't return the video's url
-            if url.startswith('/videos/search?'):
-                continue
-
-        title = extract_text(result.xpath('./a//div[@class="tl"]'))
-        content = extract_text(result.xpath('.//div[@class="pubInfo"]'))
-        thumbnail = result.xpath('.//div[@class="vthumb"]/img/@src')[0]
+        url = result.xpath('./div[@class="mc_vtvc"]/a/@href')[0]
+        url = 'https://bing.com' + url
+        title = extract_text(result.xpath('./div/a/div/div[@class="mc_vtvc_title"]/@title'))
+        content = extract_text(result.xpath('./div/a/div/div/div/div/text()'))
+        thumbnail = result.xpath('./div/a/div/div/img/@src')[0]
 
         results.append({'url': url,
                         'title': title,
@@ -92,7 +81,6 @@
                         'thumbnail': thumbnail,
                         'template': 'videos.html'})
 
-        # first page ignores requested number of results
         if len(results) >= number_of_results:
             break

{"golden_diff": "diff --git a/searx/engines/bing_videos.py b/searx/engines/bing_videos.py\n--- a/searx/engines/bing_videos.py\n+++ b/searx/engines/bing_videos.py\n@@ -69,22 +69,11 @@\n     dom = html.fromstring(resp.text)\n \n     for result in dom.xpath('//div[@class=\"dg_u\"]'):\n-\n-        # try to extract the url\n-        url_container = result.xpath('.//div[@class=\"sa_wrapper\"]/@data-eventpayload')\n-        if len(url_container) > 0:\n-            url = loads(url_container[0])['purl']\n-        else:\n-            url = result.xpath('./a/@href')[0]\n-\n-            # discard results that do not return an external url\n-            # very recent results sometimes don't return the video's url\n-            if url.startswith('/videos/search?'):\n-                continue\n-\n-        title = extract_text(result.xpath('./a//div[@class=\"tl\"]'))\n-        content = extract_text(result.xpath('.//div[@class=\"pubInfo\"]'))\n-        thumbnail = result.xpath('.//div[@class=\"vthumb\"]/img/@src')[0]\n+        url = result.xpath('./div[@class=\"mc_vtvc\"]/a/@href')[0]\n+        url = 'https://bing.com' + url\n+        title = extract_text(result.xpath('./div/a/div/div[@class=\"mc_vtvc_title\"]/@title'))\n+        content = extract_text(result.xpath('./div/a/div/div/div/div/text()'))\n+        thumbnail = result.xpath('./div/a/div/div/img/@src')[0]\n \n         results.append({'url': url,\n                         'title': title,\n@@ -92,7 +81,6 @@\n                         'thumbnail': thumbnail,\n                         'template': 'videos.html'})\n \n-        # first page ignores requested number of results\n         if len(results) >= number_of_results:\n             break\n", "issue": "Bing Video search engine doesn't work\nHallo,\r\n\r\nyesterday I've set up my own instance of searx. Thereby I discovered A problem with the Bing Video search engine. This is the shown error message:\r\n\r\n```\r\nDie folgenden Suchmaschinen k\u00f6nnen die Ergebnisse nicht empfangen:\r\nbing videos (unexpected crash: list index out of range)\r\n```\n", "before_files": [{"content": "\"\"\"\n Bing (Videos)\n\n @website     https://www.bing.com/videos\n @provide-api yes (http://datamarket.azure.com/dataset/bing/search)\n\n @using-api   no\n @results     HTML\n @stable      no\n @parse       url, title, content, thumbnail\n\"\"\"\n\nfrom json import loads\nfrom lxml import html\nfrom searx.engines.bing_images import _fetch_supported_languages, supported_languages_url, get_region_code\nfrom searx.engines.xpath import extract_text\nfrom searx.url_utils import urlencode\n\n\ncategories = ['videos']\npaging = True\nsafesearch = True\ntime_range_support = True\nnumber_of_results = 10\nlanguage_support = True\n\nsearch_url = 'https://www.bing.com/videos/asyncv2?{query}&async=content&'\\\n             'first={offset}&count={number_of_results}&CW=1366&CH=25&FORM=R5VR5'\ntime_range_string = '&qft=+filterui:videoage-lt{interval}'\ntime_range_dict = {'day': '1440',\n                   'week': '10080',\n                   'month': '43200',\n                   'year': '525600'}\n\n# safesearch definitions\nsafesearch_types = {2: 'STRICT',\n                    1: 'DEMOTE',\n                    0: 'OFF'}\n\n\n# do search-request\ndef request(query, params):\n    offset = (params['pageno'] - 1) * 10 + 1\n\n    # safesearch cookie\n    params['cookies']['SRCHHPGUSR'] = \\\n        'ADLT=' + safesearch_types.get(params['safesearch'], 'DEMOTE')\n\n    # language cookie\n    region = get_region_code(params['language'], lang_list=supported_languages)\n    params['cookies']['_EDGE_S'] = 'mkt=' + region + '&F=1'\n\n    # query and paging\n    params['url'] = search_url.format(query=urlencode({'q': query}),\n                                      offset=offset,\n                                      number_of_results=number_of_results)\n\n    # time range\n    if params['time_range'] in time_range_dict:\n        params['url'] += time_range_string.format(interval=time_range_dict[params['time_range']])\n\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    dom = html.fromstring(resp.text)\n\n    for result in dom.xpath('//div[@class=\"dg_u\"]'):\n\n        # try to extract the url\n        url_container = result.xpath('.//div[@class=\"sa_wrapper\"]/@data-eventpayload')\n        if len(url_container) > 0:\n            url = loads(url_container[0])['purl']\n        else:\n            url = result.xpath('./a/@href')[0]\n\n            # discard results that do not return an external url\n            # very recent results sometimes don't return the video's url\n            if url.startswith('/videos/search?'):\n                continue\n\n        title = extract_text(result.xpath('./a//div[@class=\"tl\"]'))\n        content = extract_text(result.xpath('.//div[@class=\"pubInfo\"]'))\n        thumbnail = result.xpath('.//div[@class=\"vthumb\"]/img/@src')[0]\n\n        results.append({'url': url,\n                        'title': title,\n                        'content': content,\n                        'thumbnail': thumbnail,\n                        'template': 'videos.html'})\n\n        # first page ignores requested number of results\n        if len(results) >= number_of_results:\n            break\n\n    return results\n", "path": "searx/engines/bing_videos.py"}], "after_files": [{"content": "\"\"\"\n Bing (Videos)\n\n @website     https://www.bing.com/videos\n @provide-api yes (http://datamarket.azure.com/dataset/bing/search)\n\n @using-api   no\n @results     HTML\n @stable      no\n @parse       url, title, content, thumbnail\n\"\"\"\n\nfrom json import loads\nfrom lxml import html\nfrom searx.engines.bing_images import _fetch_supported_languages, supported_languages_url, get_region_code\nfrom searx.engines.xpath import extract_text\nfrom searx.url_utils import urlencode\n\n\ncategories = ['videos']\npaging = True\nsafesearch = True\ntime_range_support = True\nnumber_of_results = 10\nlanguage_support = True\n\nsearch_url = 'https://www.bing.com/videos/asyncv2?{query}&async=content&'\\\n             'first={offset}&count={number_of_results}&CW=1366&CH=25&FORM=R5VR5'\ntime_range_string = '&qft=+filterui:videoage-lt{interval}'\ntime_range_dict = {'day': '1440',\n                   'week': '10080',\n                   'month': '43200',\n                   'year': '525600'}\n\n# safesearch definitions\nsafesearch_types = {2: 'STRICT',\n                    1: 'DEMOTE',\n                    0: 'OFF'}\n\n\n# do search-request\ndef request(query, params):\n    offset = (params['pageno'] - 1) * 10 + 1\n\n    # safesearch cookie\n    params['cookies']['SRCHHPGUSR'] = \\\n        'ADLT=' + safesearch_types.get(params['safesearch'], 'DEMOTE')\n\n    # language cookie\n    region = get_region_code(params['language'], lang_list=supported_languages)\n    params['cookies']['_EDGE_S'] = 'mkt=' + region + '&F=1'\n\n    # query and paging\n    params['url'] = search_url.format(query=urlencode({'q': query}),\n                                      offset=offset,\n                                      number_of_results=number_of_results)\n\n    # time range\n    if params['time_range'] in time_range_dict:\n        params['url'] += time_range_string.format(interval=time_range_dict[params['time_range']])\n\n    return params\n\n\n# get response from search-request\ndef response(resp):\n    results = []\n\n    dom = html.fromstring(resp.text)\n\n    for result in dom.xpath('//div[@class=\"dg_u\"]'):\n        url = result.xpath('./div[@class=\"mc_vtvc\"]/a/@href')[0]\n        url = 'https://bing.com' + url\n        title = extract_text(result.xpath('./div/a/div/div[@class=\"mc_vtvc_title\"]/@title'))\n        content = extract_text(result.xpath('./div/a/div/div/div/div/text()'))\n        thumbnail = result.xpath('./div/a/div/div/img/@src')[0]\n\n        results.append({'url': url,\n                        'title': title,\n                        'content': content,\n                        'thumbnail': thumbnail,\n                        'template': 'videos.html'})\n\n        if len(results) >= number_of_results:\n            break\n\n    return results\n", "path": "searx/engines/bing_videos.py"}]}