mirror of
https://github.com/searxng/searxng.git
synced 2025-07-14 16:59:21 +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
|
@ -27,17 +27,21 @@ paging = True
|
|||
# search-url
|
||||
# missing attribute: user_id, app_version, app_locale
|
||||
url = 'https://api-v2.soundcloud.com/'
|
||||
search_url = url + 'search?{query}'\
|
||||
'&variant_ids='\
|
||||
'&facet=model'\
|
||||
'&limit=20'\
|
||||
'&offset={offset}'\
|
||||
'&linked_partitioning=1'\
|
||||
'&client_id={client_id}' # noqa
|
||||
search_url = (
|
||||
url + 'search?{query}'
|
||||
'&variant_ids='
|
||||
'&facet=model'
|
||||
'&limit=20'
|
||||
'&offset={offset}'
|
||||
'&linked_partitioning=1'
|
||||
'&client_id={client_id}'
|
||||
) # noqa
|
||||
|
||||
embedded_url = '<iframe width="100%" height="166" ' +\
|
||||
'scrolling="no" frameborder="no" ' +\
|
||||
'data-src="https://w.soundcloud.com/player/?url={uri}"></iframe>'
|
||||
embedded_url = (
|
||||
'<iframe width="100%" height="166" '
|
||||
+ 'scrolling="no" frameborder="no" '
|
||||
+ 'data-src="https://w.soundcloud.com/player/?url={uri}"></iframe>'
|
||||
)
|
||||
|
||||
cid_re = re.compile(r'client_id:"([^"]*)"', re.I | re.U)
|
||||
guest_client_id = ''
|
||||
|
@ -75,9 +79,7 @@ def init(engine_settings=None):
|
|||
def request(query, params):
|
||||
offset = (params['pageno'] - 1) * 20
|
||||
|
||||
params['url'] = search_url.format(query=urlencode({'q': query}),
|
||||
offset=offset,
|
||||
client_id=guest_client_id)
|
||||
params['url'] = search_url.format(query=urlencode({'q': query}), offset=offset, client_id=guest_client_id)
|
||||
|
||||
return params
|
||||
|
||||
|
@ -98,11 +100,15 @@ def response(resp):
|
|||
embedded = embedded_url.format(uri=uri)
|
||||
|
||||
# append result
|
||||
results.append({'url': result['permalink_url'],
|
||||
'title': title,
|
||||
'publishedDate': publishedDate,
|
||||
'embedded': embedded,
|
||||
'content': content})
|
||||
results.append(
|
||||
{
|
||||
'url': result['permalink_url'],
|
||||
'title': title,
|
||||
'publishedDate': publishedDate,
|
||||
'embedded': embedded,
|
||||
'content': content,
|
||||
}
|
||||
)
|
||||
|
||||
# return results
|
||||
return results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue