@@ -31,12 +31,10 @@ from json import loads
3131from urllib.parse import urlencode
3232from flask_babel import gettext
3333
34−# from searx import logger
3534from searx.utils import match_language
3635from searx.exceptions import SearxEngineAPIException
3736from searx.network import raise_for_httperror
3837
39−#logger = logger.getChild('qwant')
4038
4139# about
4240about = {
@@ -182,19 +180,18 @@ def response(resp):
182180 })
183181
184182 elif mainline_type == 'videos':
185− # some videos do not have a description: while quant-video
186− # returns an empty string, such video from a quant-web query
183+ # some videos do not have a description: while qwant-video
184+ # returns an empty string, such video from a qwant-web query
187185 # miss the 'desc' key.
188− content = item.get('desc', '')
189− s, c = item.get('source',''), item.get('channel','')
190− if content and (s or c):
191− content += " // "
186+ d, s, c = item.get('desc'), item.get('source'), item.get('channel')
187+ content_parts = []
188+ if d:
189+ content_parts.append(d)
192190 if s:
193− content += "%s: %s " % (gettext("Source"), s)
194− if c:
195− content += "//"
191+ content_parts.append("%s: %s " % (gettext("Source"), s))
196192 if c:
197− content += " %s: %s " % (gettext("Channel"), c)
193+ content_parts.append("%s: %s " % (gettext("Channel"), c))
194+ content = ' // '.join(content_parts)
198195 length = timedelta(seconds=item['duration'])
199196 pub_date = datetime.fromtimestamp(item['date'])
200197 thumbnail = item['thumbnail']