youcast

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 28 Imported by: 0

README

YouCast — this video could've been a podcast

YouCast is a self-hosted podcast service that serves audio files adding by the user as a feed, compatible with most if not all modern podcast apps.

YouCast supports following sources of media files:

  • YouTube — add video URL and YouCast will download and extract the audio from it.
  • Telegram — send a message with an audio file attached to the Telegram bot, and it will be added to your feed.
  • Upload — upload audio file to add it to the podcast feed.

Installation

Using go1.16+:

go install github.com/andrewslotin/youcast@latest

Using Docker:

docker pull ghcr.io/andrewslotin/youcast@latest

Usage

YouCast is designed to be a low-maintenance service. Once launched, it can run permanently in your local network or a cloud instance, serving podcast to all your devices. Here is the minimal command to run an instance of this service installed with go install:

$GOPATH/bin/youcast -l :8080 -storage-dir ./downloads

This will launch a podcast server available at https://localhost:8080.

See the Configuration section for more detailed instructions.

Running YouCast outside of your local network

The common use case for YouCast is to run it inside of your home network that is not externally accessible. Since YouCast allows users to upload files, it is a really bad idea to run it on a publicly available server, such as AWS instance or a DigitalOcean droplet, without any authentication. Consider using a reverse-proxy, or any other solution of your choice.

Configuration

YouCast requires few configuration options to run. These options can be provided both as command-line arguments and environment variables. If a configuration option is provided via both env vars and args, the latter takes precedence.

Command-line flag Environment variable Description Required Default value
-l LISTEN_ADDR Server address [host]:port Yes
-storage-dir STORAGE_PATH Path to the directory where to store downloaded files Yes
-title PODCAST_TITLE Feed title, displayed as a podcast name No YouCast
-db DB_PATH Path to the database file No ./feed.db
Telegram bot

YouCast comes with a Telegram bot included. To activate the bot you need an API token, that can be obtained via @BotFather. Please consult Telegram's Bot API Guide for details.

Large file downloads

Telegram Bot API limits downloads to 20 MB per file. While this should be enough for most of use cases, some audio files may exceed it. A way to work around this limitation is to run a self-hosted Bot API server.

Whitelisting users

By default your bot will accept files from any Telegram user. It is strictly recommended to provide a list of user IDs that are allowed to send messages to the bot. You can find out your own user ID using @IDBot.

Configuration options

Here are the configuration options for the YouCast Telegram bot that you can provide via environment variables. Note that until TELEGRAM_API_TOKEN is provided, the bot remains inactive.

Environment variable Description Required Default value
TELEGRAM_API_TOKEN The token for Telegram Bot API Yes
TELEGRAM_API_ENDPOINT Telegram bot API endpoint URL. You need to set it if using a self-hosted Bot API server (details) No https://api.telegram.org
TELEGRAM_FILE_SERVER The file server URL of a self-hosted API server, if used (details) No
TELEGRAM_ALLOWED_USERS Optional list of Telegram user IDs that are allowed to add items to the feed, comma-separated (details) No

License

The creators of YouCast bear no responsibility for any illegal dissemination of copyrighted material via YouCast. This software has been conceptualized and developed for individual utilization, mandating that users secure legal authorization to access content prior to uploading it to YouCast, and abide by the specific user agreement under which it is distributed.

YouCast source code is distributed under the MIT License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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