.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.kickass Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['files']
 
bool paging = True
 
str base_url = 'https://kickasstorrents.to'
 

Detailed Description

Kickass Torrent (Videos, Music, Files)

Function Documentation

◆ request()

searx.engines.kickass.request ( query,
params )

Definition at line 33 of file kickass.py.

33def request(query, params):
34 params['base_url'] = random.choice(base_url) if isinstance(base_url, list) else base_url
35 params['url'] = params['base_url'] + f'/usearch/{quote(query)}/{params["pageno"]}/'
36
37 return params
38
39

◆ response()

searx.engines.kickass.response ( resp)

Definition at line 40 of file kickass.py.

40def response(resp):
41 results = []
42 dom = html.fromstring(resp.text)
43
44 search_res = eval_xpath_list(dom, '//table[contains(@class, "data")]//tr[descendant::a]', None)
45 if search_res is None:
46 return []
47
48 for tag in search_res[1:]:
49 result = {'template': 'torrent.html'}
50 url = eval_xpath_getindex(tag, './/a[contains(@class, "cellMainLink")]/@href', 0, None)
51 result['url'] = resp.search_params['base_url'] + url
52 result['title'] = extract_text(eval_xpath(tag, './/a[contains(@class, "cellMainLink")]'))
53 result['content'] = extract_text(eval_xpath(tag, './/span[@class="font11px lightgrey block"]'))
54 result['seed'] = int_or_zero(extract_text(eval_xpath(tag, './/td[contains(@class, "green")]')))
55 result['leech'] = int_or_zero(extract_text(eval_xpath(tag, './/td[contains(@class, "red")]')))
56 result['filesize'] = extract_text(eval_xpath(tag, './/td[contains(@class, "nobr")]'))
57
58 results.append(result)
59
60 # results sorted by seeder count
61 return sorted(results, key=itemgetter('seed'), reverse=True)

Variable Documentation

◆ about

dict searx.engines.kickass.about
Initial value:
1= {
2 "website": 'https://kickasstorrents.to',
3 "wikidata_id": 'Q17062285',
4 "official_api_documentation": None,
5 "use_official_api": False,
6 "require_api_key": False,
7 "results": 'HTML',
8}

Definition at line 17 of file kickass.py.

◆ base_url

str searx.engines.kickass.base_url = 'https://kickasstorrents.to'

Definition at line 30 of file kickass.py.

◆ categories

list searx.engines.kickass.categories = ['files']

Definition at line 26 of file kickass.py.

◆ paging

bool searx.engines.kickass.paging = True

Definition at line 27 of file kickass.py.