caddyserver / caddy

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS
https://caddyserver.com
Apache License 2.0
58.12k stars 4.03k forks source link

Plugin for generating podcast feeds #201

Closed jpoehls closed 8 years ago

jpoehls commented 9 years ago

This is a proposal for a new add-on. I don't have time to work on it myself right now but would like to get the spec flushed out and help in any other way I can.

Read, comment, let's get all the details ironed out so it is easy for someone to pick up and implement!

Use case

Generates RSS and Atom podcast feeds from a directory of audio files.

Caddy uses metadata from the audio files themselves for the episode information, or lets you provide more detailed metadata as desired.

Caddy handles generating the various podcast feed formats and ensuring compliance with fancy features of iTunes and such.

Caddy config

podcast basepath {
    dirpath
    cover           [path]
    itunes_cover    [path]
    generator       [name]
    author          [author]
    contributor     [contributor]
    publisher       [publisher]
    link            [link]
}
|- PilgrimsProgress
    |- chapter_01.mp3
    |- chapter_02.mp3
    |- chapter_03.mp3

Caddy would serve a podcast feed at /PilgrimsProgress/rss.xml with the three chapters each as episodes.

Episode generation

Each MP3 in the specified directory is included in the podcast feed as an episode. Metadata is extracted from the ID3 tags of the MP3 to provide information about the episode. Alternatively, you can provide a companion metadata file for each episode which will be used instead of the ID3 data.

https://github.com/dhowden/tag is used to extract the ID3 tags.

Here is the podcast feed metadata for episodes and how it is determined.

Order of episodes in the feed will be alphabetical based on the episode filenames.

Audio files

You can provide multiple formats for your audio by naming the files the same with different file extensions.

If you have the following file structure:

|- episode_01.mp3
|- episode_01.ogg

Then only one episode will be generated and will include both MP3 and OGG as audio formats.

We will try to extract ID3 data from the files in alphabetical order.

Side car metadata files

You can provide explicit metadata for each episode in side car file like so.

|- episode_01.mp3
|- episode_01.json|yaml|toml|xml

Example file format:

guid: _
title: _
description: _
link: _
duration: _
publication_date: _
comments: _
author: _
publisher: _
show_notes: _
enclosure: _

Serving audio files from S3, etc.

You can also serve your audio files from S3 or any other non-Caddy location by simply providing the sidecar metadata files and specifying enclosure.

Example:

|- episode_01.json|yaml|toml|xml

episode_01.yaml

     ...
     enclosure: https://example.com/path/to/episode.mp3

TODO: Specify how multiple enclosures should be specified, their file sizes, media type, etc.

TODO: In addition to a file per episode's metadata, should we also allow all episode metadata to be in a single file that we read? Something like index.json?

Podcast guidelines: https://github.com/gpodder/podcast-feed-best-practice/blob/master/podcast-feed-best-practice.md

mholt commented 8 years ago

Hey @jpoehls - thanks for your comment! This is a nice proposal, so I have linked to this issue from a thread in our community forum where we are aggregating ideas/requests for Caddy plugins.

If you want to continue discussing the plugin before development begins on it, feel free to start a new topic on the forum. :+1: Hope to see you participate with us there!