[refactor] duration strings: move parsing logic to utils.py

This commit is contained in:
Bnyro 2025-03-20 21:16:37 +01:00 committed by Markus Heiser
parent c28d35c7fc
commit 4dfc47584d
5 changed files with 42 additions and 42 deletions

View file

@ -73,7 +73,7 @@ Implementations
from urllib.parse import urlencode, urlparse
from searx import locales
from searx.network import get
from searx.utils import gen_useragent, html_to_text
from searx.utils import gen_useragent, html_to_text, parse_duration_string
about = {
"website": "https://presearch.io",
@ -270,7 +270,7 @@ def response(resp):
'url': item.get('link'),
'content': item.get('description', ''),
'thumbnail': item.get('image'),
'length': item.get('duration'),
'length': parse_duration_string(item.get('duration')),
}
)