summaryrefslogtreecommitdiff
path: root/searx/engines/imdb.py
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2021-12-27 09:26:22 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2021-12-27 09:26:22 +0100
commit3d96a9839a12649874b6d4cf9466bd3616b0a03c (patch)
treee7d54d1e345b1e792d538ddc250f4827bb2fd9b9 /searx/engines/imdb.py
parentfcdc2c2cd26e24c2aa3f064d93cee3e29dc2a30c (diff)
downloadsearxng-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/imdb.py')
-rw-r--r--searx/engines/imdb.py30
1 files changed, 13 insertions, 17 deletions
diff --git a/searx/engines/imdb.py b/searx/engines/imdb.py
index a7474fd5b..bb6258cf4 100644
--- a/searx/engines/imdb.py
+++ b/searx/engines/imdb.py
@@ -27,7 +27,9 @@ about = {
"results": 'HTML',
}
-categories = ['general', ]
+categories = [
+ 'general',
+]
paging = False
# suggestion_url = "https://sg.media-imdb.com/suggestion/{letter}/{query}.json"
@@ -35,13 +37,7 @@ suggestion_url = "https://v2.sg.media-imdb.com/suggestion/{letter}/{query}.json"
href_base = 'https://imdb.com/{category}/{entry_id}'
-search_categories = {
- "nm": "name",
- "tt": "title",
- "kw": "keyword",
- "co": "company",
- "ep": "episode"
-}
+search_categories = {"nm": "name", "tt": "title", "kw": "keyword", "co": "company", "ep": "episode"}
def request(query, params):
@@ -63,9 +59,7 @@ def response(resp):
entry_id = entry['id']
categ = search_categories.get(entry_id[:2])
if categ is None:
- logger.error(
- 'skip unknown category tag %s in %s', entry_id[:2], entry_id
- )
+ logger.error('skip unknown category tag %s in %s', entry_id[:2], entry_id)
continue
title = entry['l']
@@ -95,11 +89,13 @@ def response(resp):
if not image_url_name.endswith('_V1_'):
magic = '_V1_' + magic
image_url = image_url_name + magic + '.' + image_url_prefix
- results.append({
- "title": title,
- "url": href_base.format(category=categ, entry_id=entry_id),
- "content": content,
- "img_src" : image_url,
- })
+ results.append(
+ {
+ "title": title,
+ "url": href_base.format(category=categ, entry_id=entry_id),
+ "content": content,
+ "img_src": image_url,
+ }
+ )
return results