mirror of
https://github.com/searxng/searxng.git
synced 2025-07-30 16:42:22 +02:00
[format.python] initial formatting of the python code
This patch was generated by black [1]:: make format.python [1] https://github.com/psf/black Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
This commit is contained in:
parent
fcdc2c2cd2
commit
3d96a9839a
184 changed files with 2800 additions and 2836 deletions
|
@ -22,29 +22,33 @@ paging = True
|
|||
time_range_support = False
|
||||
safesearch = False
|
||||
|
||||
|
||||
def request(query, params):
|
||||
|
||||
params['url'] = 'https://mediathekviewweb.de/api/query'
|
||||
params['method'] = 'POST'
|
||||
params['headers']['Content-type'] = 'text/plain'
|
||||
params['data'] = dumps({
|
||||
'queries' : [
|
||||
{
|
||||
'fields' : [
|
||||
'title',
|
||||
'topic',
|
||||
],
|
||||
'query' : query
|
||||
},
|
||||
],
|
||||
'sortBy' : 'timestamp',
|
||||
'sortOrder' : 'desc',
|
||||
'future' : True,
|
||||
'offset' : (params['pageno'] - 1 )* 10,
|
||||
'size' : 10
|
||||
})
|
||||
params['data'] = dumps(
|
||||
{
|
||||
'queries': [
|
||||
{
|
||||
'fields': [
|
||||
'title',
|
||||
'topic',
|
||||
],
|
||||
'query': query,
|
||||
},
|
||||
],
|
||||
'sortBy': 'timestamp',
|
||||
'sortOrder': 'desc',
|
||||
'future': True,
|
||||
'offset': (params['pageno'] - 1) * 10,
|
||||
'size': 10,
|
||||
}
|
||||
)
|
||||
return params
|
||||
|
||||
|
||||
def response(resp):
|
||||
|
||||
resp = loads(resp.text)
|
||||
|
@ -58,11 +62,13 @@ def response(resp):
|
|||
|
||||
item['hms'] = str(datetime.timedelta(seconds=item['duration']))
|
||||
|
||||
results.append({
|
||||
'url' : item['url_video_hd'],
|
||||
'title' : "%(channel)s: %(title)s (%(hms)s)" % item,
|
||||
'length' : item['hms'],
|
||||
'content' : "%(description)s" % item,
|
||||
})
|
||||
results.append(
|
||||
{
|
||||
'url': item['url_video_hd'],
|
||||
'title': "%(channel)s: %(title)s (%(hms)s)" % item,
|
||||
'length': item['hms'],
|
||||
'content': "%(description)s" % item,
|
||||
}
|
||||
)
|
||||
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue