Skip to content

Commit 5640b32

Browse files
committed
Add a config flag to disable/enable feeds to be publically indexed
1 parent 20b6e36 commit 5640b32

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

.env.example

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ PODIMO_BIND_HOST="127.0.0.1:12104"
3232
# need a reverse proxy like Caddy, Apache, or nginx
3333
#PODIMO_PROTOCOL="http"
3434

35+
# PUBLIC_FEEDS defines whether the feeds generated by the tool
36+
# are indexed by public podcast catalogues. This allows users of
37+
# apps like Apple Podcasts or PocketCasts to find the podcasts.
38+
# The options are
39+
# - "false", the default. Podcasts will not be publically indexed.
40+
# - "true", podcasts will be indexed by podcast catalogues.
41+
#PUBLIC_FEEDS=false
42+
3543
###########
3644
# CREDENTIALS #
3745
###########

main.py

+4
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ async def podcastsToRss(podcast_id, data, locale):
336336
artist = last_episode["artist"]
337337
fg.author({"name": artist})
338338

339+
if not PUBLIC_FEEDS:
340+
fg.podcast.itunes_block(True)
341+
339342
async with ClientSession() as session:
340343
for chunk in chunks(episodes, 5):
341344
await asyncio.gather(
@@ -372,6 +375,7 @@ async def main():
372375
- PODIMO_HOSTNAME: {PODIMO_HOSTNAME}
373376
- PODIMO_BIND_HOST: {PODIMO_BIND_HOST}
374377
- PODIMO_PROTOCOL: {PODIMO_PROTOCOL}
378+
- PUBLIC_FEEDS: {PUBLIC_FEEDS}
375379
- HTTP_PROXY: {HTTP_PROXY}
376380
- ZENROWS_API: {ZENROWS_API}
377381
- SCRAPER_API: {SCRAPER_API}

podimo/config.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@
6868
# The time that the content information is cached
6969
HEAD_CACHE_TIME = int(config.get("HEAD_CACHE_TIME", 7 * 60 * 60 * 24)) # seconds = 7 days by default
7070

71+
# Whether the feeds generated with this tool should show up in public podcast catalogues
72+
PUBLIC_FEEDS = bool(str(config.get("PUBLIC_FEEDS", None)).lower() in ['true', '1', 't', 'y', 'yes'])
73+
7174
LOCALES = [
7275
'nl-NL',
7376
'de-DE',
@@ -112,4 +115,3 @@
112115
if line and not line.startswith('#'):
113116
line = line.split(' ', 1)[0]
114117
BLOCKED.add(line)
115-
#logging.debug(f'{BLOCKED}')

0 commit comments

Comments
 (0)