mirror of
https://github.com/searxng/searxng
synced 2024-11-18 15:26:25 +00:00
Merge pull request #65 from rsdy/master
[enh] sort piratebay results by seeders
This commit is contained in:
commit
637d58f2ed
@ -24,7 +24,6 @@ def request(query, params):
|
||||
pageno=params['pageno'] - 1)
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
results = []
|
||||
dom = html.fromstring(resp.text)
|
||||
@ -45,4 +44,10 @@ def response(resp):
|
||||
'leech': leech,
|
||||
'magnetlink': magnetlink.attrib['href'],
|
||||
'template': 'torrent.html'})
|
||||
return results
|
||||
return sorted(results, key=lambda x: get_int('seed'), reversed=True)
|
||||
|
||||
def get_int(field):
|
||||
try:
|
||||
return int(field)
|
||||
except TypeError:
|
||||
return 0
|
||||
|
Loading…
Reference in New Issue
Block a user