summaryrefslogtreecommitdiff
path: root/searx/engines/solidtorrents.py
diff options
context:
space:
mode:
Diffstat (limited to 'searx/engines/solidtorrents.py')
-rw-r--r--searx/engines/solidtorrents.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/searx/engines/solidtorrents.py b/searx/engines/solidtorrents.py
index 7f005c4a3..1e58996e5 100644
--- a/searx/engines/solidtorrents.py
+++ b/searx/engines/solidtorrents.py
@@ -13,6 +13,7 @@ from searx.utils import (
extract_text,
eval_xpath,
eval_xpath_getindex,
+ eval_xpath_list,
get_torrent_size,
)
@@ -55,11 +56,14 @@ def response(resp):
continue
title = extract_text(a)
url = eval_xpath_getindex(a, '@href', 0, None)
- stats = eval_xpath(result, './div//div[contains(@class, "stats")]/div')
+ categ = eval_xpath(result, './div//a[contains(@class, "category")]')
+ metadata = extract_text(categ)
+ stats = eval_xpath_list(result, './div//div[contains(@class, "stats")]/div', min_len=5)
n, u = extract_text(stats[1]).split()
filesize = get_torrent_size(n, u)
leech = extract_text(stats[2])
seed = extract_text(stats[3])
+ torrentfile = eval_xpath_getindex(result, './div//a[contains(@class, "dl-torrent")]/@href', 0, None)
magnet = eval_xpath_getindex(result, './div//a[contains(@class, "dl-magnet")]/@href', 0, None)
params = {
@@ -69,6 +73,8 @@ def response(resp):
'url': base_url_rand + url,
'filesize': filesize,
'magnetlink': magnet,
+ 'torrentfile': torrentfile,
+ 'metadata': metadata,
'template': "torrent.html",
}