summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBnyro <bnyro@tutanota.com>2023-09-30 20:25:45 +0200
committerMarkus Heiser <markus.heiser@darmarIT.de>2023-12-11 18:56:32 +0100
commitb5b81c980653a16fbb86cc43fdba4e61546b8fcc (patch)
treed76189d2f37e8382e0da7cc2a9ace54df22cdbaa
parent527e13ab4622d84830cb06a469250a0ae8c5303d (diff)
[feat] engine: implementation of fyyd
-rw-r--r--searx/engines/fyyd.py50
-rw-r--r--searx/settings.yml6
2 files changed, 56 insertions, 0 deletions
diff --git a/searx/engines/fyyd.py b/searx/engines/fyyd.py
new file mode 100644
index 00000000..10ba91f7
--- /dev/null
+++ b/searx/engines/fyyd.py
@@ -0,0 +1,50 @@
+# SPDX-License-Identifier: AGPL-3.0-or-later
+# lint: pylint
+"""Fyyd (podcasts)
+"""
+
+from datetime import datetime
+from urllib.parse import urlencode
+
+about = {
+ 'website': 'https://fyyd.de',
+ 'official_api_documentation': 'https://github.com/eazyliving/fyyd-api',
+ 'use_official_api': True,
+ 'require_api_key': False,
+ 'results': 'JSON',
+}
+categories = []
+paging = True
+
+base_url = "https://api.fyyd.de"
+page_size = 10
+
+
+def request(query, params):
+ args = {
+ 'term': query,
+ 'count': page_size,
+ 'page': params['pageno'] - 1,
+ }
+ params['url'] = f"{base_url}/0.2/search/podcast?{urlencode(args)}"
+ return params
+
+
+def response(resp):
+ results = []
+
+ json_results = resp.json()['data']
+
+ for result in json_results:
+ results.append(
+ {
+ 'url': result['htmlURL'],
+ 'title': result['title'],
+ 'content': result['description'],
+ 'thumbnail': result['smallImageURL'],
+ 'publishedDate': datetime.strptime(result['status_since'], '%Y-%m-%d %H:%M:%S'),
+ 'metadata': f"Rank: {result['rank']} || {result['episode_count']} episodes",
+ }
+ )
+
+ return results
diff --git a/searx/settings.yml b/searx/settings.yml
index e5da4903..46c7ec98 100644
--- a/searx/settings.yml
+++ b/searx/settings.yml
@@ -732,6 +732,12 @@ engines:
shortcut: frk
disabled: true
+ - name: fyyd
+ engine: fyyd
+ shortcut: fy
+ timeout: 8.0
+ disabled: true
+
- name: genius
engine: genius
shortcut: gen