miniocast

package module
v0.0.0-...-5b3c004 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2025 License: MIT Imports: 19 Imported by: 0

README

miniocast

en ja

A simple tool to turn your MinIO bucket into a Podcast server. Just add audio files, and miniocast will automatically generate and update the RSS feed and web interface.

Features

  • Use folders in your MinIO bucket as Podcast sites.
  • Automatically detects audio files (mp3, m4a, m4b) and generates/updates RSS (feed.rss) and web page (index.html).
  • File names are directly used as episode titles.
  • A half-width space in file names splits the title and subtitle.
  • Automatically detects episode numbers formatted as "第XX回" (only half-width digits).
  • Saves playback state (position and speed) in the browser's local storage.

Setup

  1. Create a MinIO bucket and a folder for your podcast, and apply a Read Only policy to the bucket.
  2. Place audio files (mp3, m4a) and a podcast image (image.jpg) in the folder.
  3. Build miniocast by running the following commands inside cmd/miniocast:
cd cmd/miniocast
go get
go build
  1. Copy config.yml.example to config.yml and edit the settings according to your environment.
Storage:
  Server: minio.example.com
  Endpoint: minio.example.com
  AccessKey: YOUR_ACCESS_KEY
  SecretKey: YOUR_SECRET_KEY
  HTTPS: true
  SecureEndpoint: true
  BucketAsVirtualHost: false

SavePlayState: true

Podcasts:
  - Title: Your Podcast Title
    Subtitle: Optional subtitle
    Author: Author Name
    Email: author@example.com
    Description: Description of your podcast
    Bucket: bucket-name
    Folder: folder-name
    Serial: 0
    Active: true
  1. Run ./miniocast to generate the RSS feed and web interface.

How to Use Your Podcast

Register the RSS feed URL directly in your podcast app:

  • RSS Feed URL: {MinIO_bucket_URL}/{folder_name}/feed.rss
  • Web Interface URL: {MinIO_bucket_URL}/{folder_name}/index.html

Acknowledgments

The web interface design utilizes JavaScript and CSS generously provided by Rui Ueyama of Turing Complete FM. We sincerely appreciate his open and generous contribution.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfos

type FileInfos []minio.ObjectInfo

FileInfos は、クラウドストレージオブジェクトの情報のスライス

func (FileInfos) Len

func (fInfo FileInfos) Len() int

Len は、FileInfosの長さを返す

func (FileInfos) Less

func (fInfo FileInfos) Less(i, j int) bool

Less は、FileInfosの小さい方を判定する

func (FileInfos) Swap

func (fInfo FileInfos) Swap(i, j int)

Swap は、FileInfosの要素を入れ替える

type Index

type Index struct {
	FileLink string
	Updated  string
}

Index は、差分比較のためのキー

type Indexes

type Indexes []Index

Indexes は、Indexのスライス

func (Indexes) Len

func (idxs Indexes) Len() int

Len は、Indexesの長さを返す

func (Indexes) Less

func (idxs Indexes) Less(i, j int) bool

Less は、Indexesの小さい方を判定する

func (Indexes) Swap

func (idxs Indexes) Swap(i, j int)

Swap は、Indexesの要素を入れ替える

type PodcastPref

type PodcastPref struct {
	Title         string
	Subtitle      string
	Author        string
	Email         string
	Description   string
	Link          string
	Bucket        string
	Folder        string
	Serial        int
	Active        bool
	SavePlayState bool
}

PodcastPref は、設定ファイルから読み込んだ各Podcastの情報を格納する

func Initialize

func Initialize() (casts []*PodcastPref, ct *minio.Client, err error)

Initialize は、設定ファイルを読み込んで初期化する

func (*PodcastPref) UpdatePodcast

func (pref *PodcastPref) UpdatePodcast(ct *minio.Client) (err error)

UpdatePodcast はフォルダに入っている音声ファイルに応じてポッドキャストを更新する

func (*PodcastPref) UpdateRSS

func (pref *PodcastPref) UpdateRSS(infos FileInfos, ct *minio.Client)

UpdateRSS は、フィードを作成あるいは更新する

func (*PodcastPref) UpdateWeb

func (pref *PodcastPref) UpdateWeb(infos FileInfos, ct *minio.Client)

UpdateWeb は、index.htmlを作成あるいは更新する

func (*PodcastPref) UpdatedInfos

func (pref *PodcastPref) UpdatedInfos(ct *minio.Client) (updatedInfos FileInfos, err error)

UpdatedInfos は、更新が必要なアイテムを返す

type RSS

type RSS struct {
	XMLName xml.Name        `xml:"rss"`
	Channel podcast.Podcast `xml:"channel"`
}

RSS はfeed.rss のデータ全体。

type Web

type Web struct {
	Title         string
	Subtitle      string
	Author        string
	Description   string
	Link          string
	Items         []*WebItem
	SavePlayState bool
}

Web は、index.htmlに含めるデータを格納する

type WebItem

type WebItem struct {
	FileURL          string
	PubDateFormatted string
	Title            string
	Subtitle         string
	Description      string
}

WebItem は、index.htmlに含める各エピソードのデータを格納する

Directories

Path Synopsis
cmd
miniocast command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL