Skip to content

Added post-download-hook configuration option#739

Merged
mxpv merged 4 commits intomxpv:mainfrom
reactorcoremeltdown:main
Jul 22, 2025
Merged

Added post-download-hook configuration option#739
mxpv merged 4 commits intomxpv:mainfrom
reactorcoremeltdown:main

Conversation

@reactorcoremeltdown
Copy link
Contributor

@reactorcoremeltdown reactorcoremeltdown commented Jul 21, 2025

Hi there!

First of all, thanks again for such a great project, I rely on it in my day-to-day life.

Part of my setup is a podsync instance that I run for my friends. Some of them like to subscribe to feeds using RSS, others prefer listening to the audio from telegram channels where I upload feed entries.

In order to make this possible I modified podsync with a configurable per-feed option allowing to specify a script for processing episode files. A configured feed looks like this:

  [feeds.foo]
  url = "https://youtube.com/channel/CHANNEL_ID"
  page_size = 3
  quality = "high"
  format = "audio"
  private_feed = true
  youtube_dl_args = ["--match-filter","!is_live","--embed-thumbnail","--add-metadata"]
  filters = {  not_title = "#shorts" }
  post_download_hook = "/usr/local/bin/uploader.sh"
  clean = { keep_last = 10 }
  cron_schedule = "*/15 9,21,22 * * *"

A script takes following environment variables:

  • EPISODE_FILE — a relative path to episode file
  • EPISODE_FEED_NAME - the name of the feed
  • EPISODE_TITLE - the title of an episode

Closes: #502

Repository owner deleted a comment from claude bot Jul 21, 2025
@mxpv
Copy link
Owner

mxpv commented Jul 21, 2025

Thanks!

I've slightly refactored/extended the implementation:

  • Allow multiple webhooks
  • Configure timeouts (useful for web queries)
  • Added unit tests
  • Updated docs

reactorcoremeltdown and others added 4 commits July 21, 2025 19:03
- Replace single PostDownloadHook string with PostEpisodeDownload []*ExecHook array
- Add ExecHook struct with Command []string and Timeout int fields
- Change EPISODE_FEED_NAME environment variable to FEED_NAME
- Use CombinedOutput() for simplified error handling with output
- Replace warnings with errors for hook execution failures
- Add comprehensive test suite using testify with env variable validation
- Support multiple hooks per lifecycle event with numbered logging
- Default timeout of 60 seconds when Timeout is 0

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
@mxpv mxpv merged commit 14bb810 into mxpv:main Jul 22, 2025
5 checks passed
@mxpv
Copy link
Owner

mxpv commented Jul 22, 2025

Merged. Pls give it a try in the next nightly build.

@reactorcoremeltdown
Copy link
Contributor Author

Hi @mxpv

Thanks for such a quick review & added corrections! I've built the current main branch and can confirm it actually works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Send webhook on feed update

2 participants