diff options
author | rinpatch <rinpatch@airmail.cc> | 2018-04-27 08:29:17 +0300 |
---|---|---|
committer | rinpatch <rinpatch@airmail.cc> | 2018-04-27 08:29:17 +0300 |
commit | b8b23d800640c3fb07e0110008ddb633277b045e (patch) | |
tree | c8fc8607c1c6d36c409d48bbe2c95705fb5c39d4 | |
parent | fb364ffae7f5a41ab4b6b4ecbc2a9194da532a5c (diff) | |
download | searxng-b8b23d800640c3fb07e0110008ddb633277b045e.tar.gz searxng-b8b23d800640c3fb07e0110008ddb633277b045e.zip |
Hopefully fix code style errors(again)
-rw-r--r-- | searx/engines/acgsou.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/searx/engines/acgsou.py b/searx/engines/acgsou.py index ad4234571..5a1571011 100644 --- a/searx/engines/acgsou.py +++ b/searx/engines/acgsou.py @@ -28,16 +28,18 @@ xpath_title = './/td[3]/a[last()]' xpath_torrent_links = './/td[3]/a' xpath_filesize = './/td[4]/text()' + def request(query, params): query = urlencode({'keyword': query}) params['url'] = search_url.format(query=query, offset=params['pageno']) return params + def response(resp): results = [] dom = html.fromstring(resp.text) print(resp.text) - for result in dom.xpath(xpath_results): + for result in dom.xpath(xpath_results): # defaults filesize = 0 magnet_link = "magnet:?xt=urn:btih:{}&tr=http://tracker.acgsou.com:2710/announce" @@ -59,12 +61,12 @@ def response(resp): filesize = filesize_info[:-2] filesize_multiplier = filesize_info[-2:] filesize = get_torrent_size(filesize, filesize_multiplier) - except : + except: pass #I didn't add download/seed/leech count since as I figured out they are generated randowmly everytime content = 'Category: "{category}".' content = content.format(category=category) - + results.append({'url': href, 'title': title, 'content': content, |