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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['images']
 
bool paging = False
 
str base_url = 'https://1x.com'
 
str search_url = base_url + '/backend/search.php?{query}'
 
str gallery_url = 'https://gallery.1x.com/'
 

Detailed Description

1x (Images)

Function Documentation

◆ request()

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

Definition at line 32 of file www1x.py.

32def request(query, params):
33 params['url'] = search_url.format(query=urlencode({'q': query}))
34
35 return params
36
37
38# get response from search-request

◆ response()

searx.engines.www1x.response ( resp)

Definition at line 39 of file www1x.py.

39def response(resp):
40 results = []
41 xmldom = etree.fromstring(resp.content)
42 xmlsearchresult = eval_xpath_getindex(xmldom, '//data', 0)
43 dom = html.fragment_fromstring(xmlsearchresult.text, create_parent='div')
44 for link in eval_xpath_list(dom, '//a'):
45 url = urljoin(base_url, link.attrib.get('href'))
46 title = extract_text(link)
47 thumbnail_src = urljoin(
48 gallery_url, (eval_xpath_getindex(link, './/img', 0).attrib['src']).replace(base_url, '')
49 )
50 # append result
51 results.append(
52 {
53 'url': url,
54 'title': title,
55 'img_src': thumbnail_src,
56 'content': '',
57 'thumbnail_src': thumbnail_src,
58 'template': 'images.html',
59 }
60 )
61
62 # return results
63 return results

Variable Documentation

◆ about

dict searx.engines.www1x.about
Initial value:
1= {
2 "website": 'https://1x.com/',
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 12 of file www1x.py.

◆ base_url

str searx.engines.www1x.base_url = 'https://1x.com'

Definition at line 26 of file www1x.py.

◆ categories

list searx.engines.www1x.categories = ['images']

Definition at line 22 of file www1x.py.

◆ gallery_url

str searx.engines.www1x.gallery_url = 'https://gallery.1x.com/'

Definition at line 28 of file www1x.py.

◆ paging

bool searx.engines.www1x.paging = False

Definition at line 23 of file www1x.py.

◆ search_url

str searx.engines.www1x.search_url = base_url + '/backend/search.php?{query}'

Definition at line 27 of file www1x.py.