Merge pull request #614 from return42/pylint-bing-video

[pylint] Bing (Videos) engine
This commit is contained in:
Markus Heiser 2021-12-29 09:30:10 +01:00 committed by GitHub
commit 5cbbdc305f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,12 +1,14 @@
# SPDX-License-Identifier: AGPL-3.0-or-later
"""
Bing (Videos)
# lint: pylint
"""Bing (Videos)
"""
from json import loads
from lxml import html
from urllib.parse import urlencode
from lxml import html
from searx.utils import match_language
from searx.engines.bing import language_aliases
@ -82,7 +84,6 @@ def response(resp):
dom = html.fromstring(resp.text)
for result in dom.xpath('//div[@class="dg_u"]'):
try:
metadata = loads(result.xpath('.//div[@class="vrhdata"]/@vrhm')[0])
info = ' - '.join(result.xpath('.//div[@class="mc_vtvc_meta_block"]//span/text()')).strip()
content = '{0} - {1}'.format(metadata['du'], info)
@ -97,7 +98,4 @@ def response(resp):
}
)
except:
continue
return results