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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['videos']
 
bool paging = True
 
str base_url = 'https://rumble.com/'
 
str url_xpath = './/a[@class="video-item--a"]/@href'
 
str thumbnail_xpath = './/img[@class="video-item--img"]/@src'
 
str title_xpath = './/h3[@class="video-item--title"]'
 
str published_date = './/time[@class="video-item--meta video-item--time"]/@datetime'
 
str earned_xpath = './/span[@class="video-item--meta video-item--earned"]/@data-value'
 
str views_xpath = './/span[@class="video-item--meta video-item--views"]/@data-value'
 
str rumbles_xpath = './/span[@class="video-item--meta video-item--rumbles"]/@data-value'
 
str author_xpath = './/div[@class="ellipsis-1"]'
 
str length_xpath = './/span[@class="video-item--duration"]/@data-value'
 

Detailed Description

Rumble (Videos)

Function Documentation

◆ request()

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

Definition at line 41 of file rumble.py.

41def request(query, params):
42 args = {"q": query}
43 if params["pageno"] > 1:
44 args['page'] = params["pageno"]
45 params['url'] = f'{base_url}search/video?{urlencode(args)}'
46 return params
47
48

◆ response()

searx.engines.rumble.response ( resp)

Definition at line 49 of file rumble.py.

49def response(resp):
50 results = []
51 dom = html.fromstring(resp.text)
52 results_dom = dom.xpath('//li[contains(@class, "video-listing-entry")]')
53
54 if not results_dom:
55 return []
56
57 for result_dom in results_dom:
58 url = base_url + extract_text(result_dom.xpath(url_xpath))
59 thumbnail = extract_text(result_dom.xpath(thumbnail_xpath))
60 title = extract_text(result_dom.xpath(title_xpath))
61 p_date = extract_text(result_dom.xpath(published_date))
62 # fix offset date for line 644 webapp.py check
63 fixed_date = datetime.strptime(p_date, '%Y-%m-%dT%H:%M:%S%z')
64 earned = extract_text(result_dom.xpath(earned_xpath))
65 views = extract_text(result_dom.xpath(views_xpath))
66 rumbles = extract_text(result_dom.xpath(rumbles_xpath))
67 author = extract_text(result_dom.xpath(author_xpath))
68 length = extract_text(result_dom.xpath(length_xpath))
69 if earned:
70 content = f"{views} views - {rumbles} rumbles - ${earned}"
71 else:
72 content = f"{views} views - {rumbles} rumbles"
73
74 results.append(
75 {
76 'url': url,
77 'title': title,
78 'content': content,
79 'author': author,
80 'length': length,
81 'template': 'videos.html',
82 'publishedDate': fixed_date,
83 'thumbnail': thumbnail,
84 }
85 )
86 return results

Variable Documentation

◆ about

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

Definition at line 14 of file rumble.py.

◆ author_xpath

str searx.engines.rumble.author_xpath = './/div[@class="ellipsis-1"]'

Definition at line 37 of file rumble.py.

◆ base_url

str searx.engines.rumble.base_url = 'https://rumble.com/'

Definition at line 28 of file rumble.py.

◆ categories

list searx.engines.rumble.categories = ['videos']

Definition at line 24 of file rumble.py.

◆ earned_xpath

str searx.engines.rumble.earned_xpath = './/span[@class="video-item--meta video-item--earned"]/@data-value'

Definition at line 34 of file rumble.py.

◆ length_xpath

str searx.engines.rumble.length_xpath = './/span[@class="video-item--duration"]/@data-value'

Definition at line 38 of file rumble.py.

◆ paging

bool searx.engines.rumble.paging = True

Definition at line 25 of file rumble.py.

◆ published_date

str searx.engines.rumble.published_date = './/time[@class="video-item--meta video-item--time"]/@datetime'

Definition at line 33 of file rumble.py.

◆ rumbles_xpath

str searx.engines.rumble.rumbles_xpath = './/span[@class="video-item--meta video-item--rumbles"]/@data-value'

Definition at line 36 of file rumble.py.

◆ thumbnail_xpath

str searx.engines.rumble.thumbnail_xpath = './/img[@class="video-item--img"]/@src'

Definition at line 31 of file rumble.py.

◆ title_xpath

str searx.engines.rumble.title_xpath = './/h3[@class="video-item--title"]'

Definition at line 32 of file rumble.py.

◆ url_xpath

str searx.engines.rumble.url_xpath = './/a[@class="video-item--a"]/@href'

Definition at line 30 of file rumble.py.

◆ views_xpath

str searx.engines.rumble.views_xpath = './/span[@class="video-item--meta video-item--views"]/@data-value'

Definition at line 35 of file rumble.py.