.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
podcastindex.py
Go to the documentation of this file.
1
# SPDX-License-Identifier: AGPL-3.0-or-later
2
"""Podcast Index
3
"""
4
5
from
urllib.parse
import
quote_plus
6
from
datetime
import
datetime
7
8
about = {
9
'website'
:
'https://podcastindex.org'
,
10
'official_api_documentation'
:
None
,
# requires an account
11
'use_official_api'
:
False
,
12
'require_api_key'
:
False
,
13
'results'
:
'JSON'
,
14
}
15
categories = []
16
17
base_url =
"https://podcastindex.org"
18
19
20
def
request
(query, params):
21
params[
'url'
] = f
"{base_url}/api/search/byterm?q={quote_plus(query)}"
22
return
params
23
24
25
def
response
(resp):
26
results = []
27
28
json = resp.json()
29
30
for
result
in
json[
'feeds'
]:
31
results.append(
32
{
33
'url'
: result[
'link'
],
34
'title'
: result[
'title'
],
35
'content'
: result[
'description'
],
36
'thumbnail'
: result[
'image'
],
37
'publishedDate'
: datetime.utcfromtimestamp(result[
'newestItemPubdate'
]),
38
'metadata'
: f
"{result['author']}, {result['episodeCount']} episodes"
,
39
}
40
)
41
42
return
results
searx.engines.podcastindex.request
request(query, params)
Definition
podcastindex.py:20
searx.engines.podcastindex.response
response(resp)
Definition
podcastindex.py:25
searxng
searx
engines
podcastindex.py
Generated on Sat Nov 16 2024 00:10:57 for .oO SearXNG Developer Documentation Oo. by
1.12.0