From e9f8412a6e4b399a3335da73b3d321104bb0c4fb Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 12 Jun 2024 22:35:13 +0200 Subject: [perf] torrents.html, files.html: don't parse and re-format filesize --- searx/engines/nyaa.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'searx/engines/nyaa.py') diff --git a/searx/engines/nyaa.py b/searx/engines/nyaa.py index c22339dbf..f3862f503 100644 --- a/searx/engines/nyaa.py +++ b/searx/engines/nyaa.py @@ -9,7 +9,6 @@ from lxml import html from searx.utils import ( eval_xpath_getindex, extract_text, - get_torrent_size, int_or_zero, ) @@ -99,11 +98,7 @@ def response(resp): # let's try to calculate the torrent size - filesize = None - filesize_info = eval_xpath_getindex(result, xpath_filesize, 0, '') - if filesize_info: - filesize_info = result.xpath(xpath_filesize)[0] - filesize = get_torrent_size(*filesize_info.split()) + filesize = eval_xpath_getindex(result, xpath_filesize, 0, '') # content string contains all information not included into template content = 'Category: "{category}". Downloaded {downloads} times.' -- cgit v1.2.3