|
@@ -24,7 +24,6 @@ def request(query, params):
|
24
|
24
|
pageno=params['pageno'] - 1)
|
25
|
25
|
return params
|
26
|
26
|
|
27
|
|
-
|
28
|
27
|
def response(resp):
|
29
|
28
|
results = []
|
30
|
29
|
dom = html.fromstring(resp.text)
|
|
@@ -45,4 +44,10 @@ def response(resp):
|
45
|
44
|
'leech': leech,
|
46
|
45
|
'magnetlink': magnetlink.attrib['href'],
|
47
|
46
|
'template': 'torrent.html'})
|
48
|
|
- return results
|
|
47
|
+ return sorted(results, key=lambda x: get_int('seed'), reversed=True)
|
|
48
|
+
|
|
49
|
+def get_int(field):
|
|
50
|
+ try:
|
|
51
|
+ return int(field)
|
|
52
|
+ except TypeError:
|
|
53
|
+ return 0
|