.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
fyyd.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Fyyd (podcasts)
3
"""
4
5
from
datetime
import
datetime
6
from
urllib.parse
import
urlencode
7
8
about = {
9
'website'
:
'https://fyyd.de'
,
10
'official_api_documentation'
:
'https://github.com/eazyliving/fyyd-api'
,
11
'use_official_api'
:
True
,
12
'require_api_key'
:
False
,
13
'results'
:
'JSON'
,
14
}
15
categories = []
16
paging =
True
17
18
base_url =
"https://api.fyyd.de"
19
page_size = 10
20
21
22
def
request
(query, params):
23
args = {
24
'term'
: query,
25
'count'
: page_size,
26
'page'
: params[
'pageno'
] - 1,
27
}
28
params[
'url'
] = f
"{base_url}/0.2/search/podcast?{urlencode(args)}"
29
return
params
30
31
32
def
response
(resp):
33
results = []
34
35
json_results = resp.json()[
'data'
]
36
37
for
result
in
json_results:
38
results.append(
39
{
40
'url'
: result[
'htmlURL'
],
41
'title'
: result[
'title'
],
42
'content'
: result[
'description'
],
43
'thumbnail'
: result[
'smallImageURL'
],
44
'publishedDate'
: datetime.strptime(result[
'status_since'
],
'%Y-%m-%d %H:%M:%S'
),
45
'metadata'
: f
"Rank: {result['rank']} || {result['episode_count']} episodes"
,
46
}
47
)
48
49
return
results
searx.engines.fyyd.request
request(query, params)
Definition
fyyd.py:22
searx.engines.fyyd.response
response(resp)
Definition
fyyd.py:32
searxng
searx
engines
fyyd.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0