diff options
author | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-27 09:26:22 +0100 |
---|---|---|
committer | Markus Heiser <markus.heiser@darmarit.de> | 2021-12-27 09:26:22 +0100 |
commit | 3d96a9839a12649874b6d4cf9466bd3616b0a03c (patch) | |
tree | e7d54d1e345b1e792d538ddc250f4827bb2fd9b9 /searx/engines/mediathekviewweb.py | |
parent | fcdc2c2cd26e24c2aa3f064d93cee3e29dc2a30c (diff) | |
download | searxng-3d96a9839a12649874b6d4cf9466bd3616b0a03c.tar.gz searxng-3d96a9839a12649874b6d4cf9466bd3616b0a03c.zip |
[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>
Diffstat (limited to 'searx/engines/mediathekviewweb.py')
-rw-r--r-- | searx/engines/mediathekviewweb.py | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/searx/engines/mediathekviewweb.py b/searx/engines/mediathekviewweb.py index d4cb853d4..991dcbc7b 100644 --- a/searx/engines/mediathekviewweb.py +++ b/searx/engines/mediathekviewweb.py @@ -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 |