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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
str url = 'https://1337x.to/'
 
str search_url = url + 'search/{search_term}/{pageno}/'
 
list categories = ['files']
 
bool paging = True
 

Function Documentation

◆ request()

searx.engines.1337x.request ( query,
params )

Definition at line 27 of file 1337x.py.

27def request(query, params):
28 params['url'] = search_url.format(search_term=quote(query), pageno=params['pageno'])
29
30 return params
31
32

◆ response()

searx.engines.1337x.response ( resp)

Definition at line 33 of file 1337x.py.

33def response(resp):
34 results = []
35
36 dom = html.fromstring(resp.text)
37
38 for result in eval_xpath_list(dom, '//table[contains(@class, "table-list")]/tbody//tr'):
39 href = urljoin(url, eval_xpath_getindex(result, './td[contains(@class, "name")]/a[2]/@href', 0))
40 title = extract_text(eval_xpath(result, './td[contains(@class, "name")]/a[2]'))
41 seed = extract_text(eval_xpath(result, './/td[contains(@class, "seeds")]'))
42 leech = extract_text(eval_xpath(result, './/td[contains(@class, "leeches")]'))
43 filesize = extract_text(eval_xpath(result, './/td[contains(@class, "size")]/text()'))
44
45 results.append(
46 {
47 'url': href,
48 'title': title,
49 'seed': seed,
50 'leech': leech,
51 'filesize': filesize,
52 'template': 'torrent.html',
53 }
54 )
55
56 return results

Variable Documentation

◆ about

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

Definition at line 12 of file 1337x.py.

◆ categories

list searx.engines.1337x.categories = ['files']

Definition at line 23 of file 1337x.py.

◆ paging

bool searx.engines.1337x.paging = True

Definition at line 24 of file 1337x.py.

◆ search_url

str searx.engines.1337x.search_url = url + 'search/{search_term}/{pageno}/'

Definition at line 22 of file 1337x.py.

◆ url

str searx.engines.1337x.url = 'https://1337x.to/'

Definition at line 21 of file 1337x.py.