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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['videos', 'music', 'files']
 
bool paging = True
 
str URL = 'https://digbt.org'
 
str SEARCH_URL = URL + '/search/{query}-time-{pageno}'
 
int FILESIZE = 3
 
int FILESIZE_MULTIPLIER = 4
 

Detailed Description

 DigBT (Videos, Music, Files)

Function Documentation

◆ request()

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

Definition at line 29 of file digbt.py.

29def request(query, params):
30 params['url'] = SEARCH_URL.format(query=query, pageno=params['pageno'])
31
32 return params
33
34

◆ response()

searx.engines.digbt.response ( resp)

Definition at line 35 of file digbt.py.

35def response(resp):
36 dom = html.fromstring(resp.text)
37 search_res = dom.xpath('.//td[@class="x-item"]')
38
39 if not search_res:
40 return []
41
42 results = []
43 for result in search_res:
44 url = urljoin(URL, result.xpath('.//a[@title]/@href')[0])
45 title = extract_text(result.xpath('.//a[@title]'))
46 content = extract_text(result.xpath('.//div[@class="files"]'))
47 files_data = extract_text(result.xpath('.//div[@class="tail"]')).split()
48 filesize = f"{files_data[FILESIZE]} {files_data[FILESIZE_MULTIPLIER]}"
49 magnetlink = result.xpath('.//div[@class="tail"]//a[@class="title"]/@href')[0]
50
51 results.append(
52 {
53 'url': url,
54 'title': title,
55 'content': content,
56 'filesize': filesize,
57 'magnetlink': magnetlink,
58 'seed': 'N/A',
59 'leech': 'N/A',
60 'template': 'torrent.html',
61 }
62 )
63
64 return results

Variable Documentation

◆ about

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

Definition at line 11 of file digbt.py.

◆ categories

list searx.engines.digbt.categories = ['videos', 'music', 'files']

Definition at line 20 of file digbt.py.

◆ FILESIZE

int searx.engines.digbt.FILESIZE = 3

Definition at line 25 of file digbt.py.

◆ FILESIZE_MULTIPLIER

int searx.engines.digbt.FILESIZE_MULTIPLIER = 4

Definition at line 26 of file digbt.py.

◆ paging

bool searx.engines.digbt.paging = True

Definition at line 21 of file digbt.py.

◆ SEARCH_URL

str searx.engines.digbt.SEARCH_URL = URL + '/search/{query}-time-{pageno}'

Definition at line 24 of file digbt.py.

◆ URL

str searx.engines.digbt.URL = 'https://digbt.org'

Definition at line 23 of file digbt.py.