Skip to content

Commit

Permalink
Add a config flag to disable/enable feeds to be publically indexed
Browse files Browse the repository at this point in the history
  • Loading branch information
ThijsRay committed Feb 29, 2024
1 parent 20b6e36 commit 5640b32
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ PODIMO_BIND_HOST="127.0.0.1:12104"
# need a reverse proxy like Caddy, Apache, or nginx
#PODIMO_PROTOCOL="http"

# PUBLIC_FEEDS defines whether the feeds generated by the tool
# are indexed by public podcast catalogues. This allows users of
# apps like Apple Podcasts or PocketCasts to find the podcasts.
# The options are
# - "false", the default. Podcasts will not be publically indexed.
# - "true", podcasts will be indexed by podcast catalogues.
#PUBLIC_FEEDS=false

###########
# CREDENTIALS #
###########
Expand Down
4 changes: 4 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ async def podcastsToRss(podcast_id, data, locale):
artist = last_episode["artist"]
fg.author({"name": artist})

if not PUBLIC_FEEDS:
fg.podcast.itunes_block(True)

async with ClientSession() as session:
for chunk in chunks(episodes, 5):
await asyncio.gather(
Expand Down Expand Up @@ -372,6 +375,7 @@ async def main():
- PODIMO_HOSTNAME: {PODIMO_HOSTNAME}
- PODIMO_BIND_HOST: {PODIMO_BIND_HOST}
- PODIMO_PROTOCOL: {PODIMO_PROTOCOL}
- PUBLIC_FEEDS: {PUBLIC_FEEDS}
- HTTP_PROXY: {HTTP_PROXY}
- ZENROWS_API: {ZENROWS_API}
- SCRAPER_API: {SCRAPER_API}
Expand Down
4 changes: 3 additions & 1 deletion podimo/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
# The time that the content information is cached
HEAD_CACHE_TIME = int(config.get("HEAD_CACHE_TIME", 7 * 60 * 60 * 24)) # seconds = 7 days by default

# Whether the feeds generated with this tool should show up in public podcast catalogues
PUBLIC_FEEDS = bool(str(config.get("PUBLIC_FEEDS", None)).lower() in ['true', '1', 't', 'y', 'yes'])

LOCALES = [
'nl-NL',
'de-DE',
Expand Down Expand Up @@ -112,4 +115,3 @@
if line and not line.startswith('#'):
line = line.split(' ', 1)[0]
BLOCKED.add(line)
#logging.debug(f'{BLOCKED}')

0 comments on commit 5640b32

Please sign in to comment.