From ce836b2d4665e7aed6e69a5604e0748b6c34ae91 Mon Sep 17 00:00:00 2001 From: ari melody Date: Fri, 30 Jan 2026 18:53:09 +0000 Subject: [PATCH] update README, lots of polish --- README.md | 72 ++++++++---- config/config.go | 2 +- go.mod | 2 +- main.go | 86 ++++++++------ res/help.txt | 12 +- scanner/scanner.go | 2 +- {template => templates}/description.txt | 2 +- {template => templates}/tags.txt | 0 {template => templates}/title.txt | 2 +- video/video.go | 2 +- youtube/youtube.go | 149 ++++++++++++++++-------- 11 files changed, 210 insertions(+), 121 deletions(-) rename {template => templates}/description.txt (89%) rename {template => templates}/tags.txt (100%) rename {template => templates}/title.txt (52%) diff --git a/README.md b/README.md index fa2f491..0ff7654 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,39 @@ -# ari's VOD uploader +# Vodular +This tool stitches together livestream VOD segments (in `.mkv`format) and automatically uploads them to YouTube, complete with customisable metadata such as titles, descriptions, and tags. -This tool stitches together livestream VOD segments and automatically uploads -them to YouTube. +I built this to greatly simplify the process of getting my full-quality livestream VODs onto YouTube, and I'm open-sourcing it in the hopes that it helps someone else with their workflow. As such, personal forks are welcome and encouraged! -This tool expects to be run in a directory containing a [metadata](#metadata) -file, and targeting a footage directory containing `.mkv` files (these are -really quick and easy to stitch together). +## Quick Jump +- [Basic Usage](#basic-usage) +- [VOD Metadata](#vod-metadata) +- [Templates](#templates) -The template [title](template/title.txt) and -[description](template/description.txt) files contain my current format -for VOD upload metadata. They use generic Go templates - -## Basic usage - -Initialise a VOD directory: +## Basic usage +1. Run the tool for the first time to generate a starter configuration file: ```sh -vod-uploader --init /path/to/media +$ vodular +New config file created (config.toml). Please edit this file before running again! ``` -Upload a VOD, deleting the redundant full VOD export afterwards: +2. Edit configuration file as necessary (You will need to create a [YouTube Data API v3](https://developers.google.com/youtube/v3) service and provide its credentials here). +> [!IMPORTANT] `config.toml` contains very sensitive credentials. Do not share this file with anyone. + +3. Initialise a VOD directory: ```sh -vod-uploader -d /path/to/media +$ vodular --init /path/to/vod +Directory successfully initialised. Be sure to update metadata.toml before uploading! ``` -## Metadata +4. Modify your newly-created `metadata.toml` to your liking. +5. Upload a VOD (Optionally, delete the redundant full VOD export afterwards): +```sh +$ vodular --deleteAfter /path/to/vod +``` + +> [!NOTE] On first run, you will be prompted to sign in to YouTube with the channel you wish to upload to. To sign out, simply run `vodular --logout`. + +## VOD Metadata When `--init`ialising a directory, a `metadata.toml` file is created. This is a plain-text file providing some simple options to customise uploads per directory. See this example file with additional comments: @@ -46,18 +55,33 @@ uploaded = false # (Optional) Category details, for additional credits. [category] -#  +# Game titles and generic categories are applicable here, i.e. "Minecraft", "Art", etc. name = 'This Thing' # Valid types: gaming, other (default: other) type = 'other' url = 'https://example.org' ``` -## Options -- `-h`, --help`: Show a help message. -- `-v`, --verbose`: Show verbose logging output. -- `--init`: Initialise `directory` as a VOD directory. -- `-d`, --deleteAfter`: Deletes the full VOD after upload. -- `-f`, --force`: Force uploading the VOD, even if it already exists. +## Templates +Template files can be created at `templates/title.txt`, +`template/description.txt`, and `templates/tags.txt` respectively. These +files can use Go's [text template format](https://pkg.go.dev/text/template) to +customise VOD metadata on upload. + +You can use the following data in templates: +- **`.Title`:** The title of the stream. +- **`.Date`:** The date of the stream. +- **`.Part`:** The part number of the stream (Good for episodic streams!) +- **`.Category`:** Stream category details. (**NOTE:** Wrap usage in `{{if .Category}}` to ensure this field exists first!) +- **`.Category.Name`:** The stream category name (Game titles and generic categories are applicable here, i.e. "Minecraft", "Art", etc.) +- **`.Category.Type`:** At this time, should only ever be `"gaming"` or `"other"`. +- **`.Category.Url`:** A URL relevant to the category. Use this to direct viewers to what you were checking out! + +Some helper functions are also provided: +- **`FormatTime