on master help sign in
Hopefully fix code style errors(again)
commitb8b23d800640c3fb07e0110008ddb633277b045e authorrinpatch <rinpatch@airmail.cc> dateFri 27 Apr 2018, 08:29 (9 years ago) parentfb364ff
1 file changed+5−3
searx/engines/acgsou.py+5−3
searx/engines/acgsou.py+5−3
@@ -28,16 +28,18 @@ xpath_title = './/td[3]/a[last()]'
2828xpath_torrent_links = './/td[3]/a'
2929xpath_filesize = './/td[4]/text()'
3030
31+
3132def request(query, params):
3233 query = urlencode({'keyword': query})
3334 params['url'] = search_url.format(query=query, offset=params['pageno'])
3435 return params
3536
37+
3638def response(resp):
3739 results = []
3840 dom = html.fromstring(resp.text)
3941 print(resp.text)
40− for result in dom.xpath(xpath_results):
42+ for result in dom.xpath(xpath_results):
4143 # defaults
4244 filesize = 0
4345 magnet_link = "magnet:?xt=urn:btih:{}&tr=http://tracker.acgsou.com:2710/announce"
@@ -59,12 +61,12 @@ def response(resp):
5961 filesize = filesize_info[:-2]
6062 filesize_multiplier = filesize_info[-2:]
6163 filesize = get_torrent_size(filesize, filesize_multiplier)
62− except :
64+ except:
6365 pass
6466 #I didn't add download/seed/leech count since as I figured out they are generated randowmly everytime
6567 content = 'Category: "{category}".'
6668 content = content.format(category=category)
67−
69+
6870 results.append({'url': href,
6971 'title': title,
7072 'content': content,