summaryrefslogtreecommitdiff
path: root/searx/engines/nyaa.py
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2024-06-12 22:35:13 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2024-06-15 15:42:29 +0200
commite9f8412a6e4b399a3335da73b3d321104bb0c4fb (patch)
tree0caf5c1bede7bb8739c5c2e5d107fa75455ecc24 /searx/engines/nyaa.py
parent16ce5612dd0ef426b6851ab97b248595f3933d8f (diff)
[perf] torrents.html, files.html: don't parse and re-format filesize
Diffstat (limited to 'searx/engines/nyaa.py')
-rw-r--r--searx/engines/nyaa.py7
1 files changed, 1 insertions, 6 deletions
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.'