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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['videos']
 
bool paging = True
 
str api_url = "https://api.media.ccc.de"
 

Detailed Description

media.ccc.de

Function Documentation

◆ request()

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

Definition at line 22 of file ccc_media.py.

22def request(query, params):
23 args = {'q': query, 'page': params['pageno']}
24 params['url'] = f"{api_url}/public/events/search?{urlencode(args)}"
25
26 return params
27
28

◆ response()

searx.engines.ccc_media.response ( resp)

Definition at line 29 of file ccc_media.py.

29def response(resp):
30 results = []
31
32 for item in resp.json()['events']:
33 publishedDate = None
34 if item.get('date'):
35 publishedDate = parser.parse(item['date'])
36
37 iframe_src = None
38 for rec in item['recordings']:
39 if rec['mime_type'].startswith('video'):
40 if not iframe_src:
41 iframe_src = rec['recording_url']
42 elif rec['mime_type'] == 'video/mp4':
43 # prefer mp4 (minimal data rates)
44 iframe_src = rec['recording_url']
45
46 results.append(
47 {
48 'template': 'videos.html',
49 'url': item['frontend_link'],
50 'title': item['title'],
51 'content': item['description'],
52 'thumbnail': item['thumb_url'],
53 'publishedDate': publishedDate,
54 'length': datetime.timedelta(seconds=item['length']),
55 'iframe_src': iframe_src,
56 }
57 )
58
59 return results

Variable Documentation

◆ about

dict searx.engines.ccc_media.about
Initial value:
1= {
2 'website': 'https://media.ccc.de',
3 'official_api_documentation': 'https://github.com/voc/voctoweb',
4 'use_official_api': True,
5 'require_api_key': False,
6 'results': 'JSON',
7}

Definition at line 9 of file ccc_media.py.

◆ api_url

str searx.engines.ccc_media.api_url = "https://api.media.ccc.de"

Definition at line 19 of file ccc_media.py.

◆ categories

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

Definition at line 16 of file ccc_media.py.

◆ paging

bool searx.engines.ccc_media.paging = True

Definition at line 17 of file ccc_media.py.