update documentation
This commit is contained in:
parent
0abafd26c5
commit
75534da702
3 changed files with 43 additions and 51 deletions
42
README.md
42
README.md
|
|
@ -1,7 +1,12 @@
|
||||||
# Vodular
|
# 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, tags, and a thumbnail!
|
This tool stitches together livestream VOD segments (in `.mkv` format) and
|
||||||
|
automatically uploads them to YouTube, complete with customisable metadata such
|
||||||
|
as titles, descriptions, tags, and a thumbnail!
|
||||||
|
|
||||||
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!
|
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!
|
||||||
|
|
||||||
## Quick Jump
|
## Quick Jump
|
||||||
- [Basic Usage](#basic-usage)
|
- [Basic Usage](#basic-usage)
|
||||||
|
|
@ -9,40 +14,40 @@ I built this to greatly simplify the process of getting my full-quality livestre
|
||||||
- [Templates](#templates)
|
- [Templates](#templates)
|
||||||
|
|
||||||
## Basic usage
|
## Basic usage
|
||||||
1. Run the tool for the first time to generate a starter configuration file:
|
1. Run `vodular` for the first time to generate a starter configuration file:
|
||||||
```sh
|
|
||||||
$ vodular
|
|
||||||
New config file created (config.toml). Please edit this file before running again!
|
|
||||||
```
|
|
||||||
The directory which holds your configuration file and templates varies,
|
The directory which holds your configuration file and templates varies,
|
||||||
depending on platform:
|
depending on platform:
|
||||||
- **Linux:** `~/.config/vodular/templates`
|
- **Linux:** `~/.config/vodular/templates`
|
||||||
- **macOS:** `~/Library/Application Support/vodular/templates`
|
- **macOS:** `~/Library/Application Support/vodular/templates`
|
||||||
- **Windows:** `%AppData%/vodular/templates`
|
- **Windows:** `%AppData%/vodular/templates`
|
||||||
|
|
||||||
2. Edit your 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).
|
2. Edit your configuration file as necessary (You will need to create a
|
||||||
**IMPORTANT:** `config.toml` contains very sensitive credentials. Do not share this file with anyone.
|
[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:
|
3. Initialise a VOD directory:
|
||||||
```sh
|
```sh
|
||||||
$ vodular --init /path/to/vod
|
vodular --init /path/to/vod
|
||||||
Directory successfully initialised. Be sure to update metadata.toml before uploading!
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This directory should contain:
|
This directory should contain:
|
||||||
- A `metadata.toml` file
|
- A `metadata.toml` file
|
||||||
- Your footage files, either at the root of the directory or in a specified subdirectory
|
- Your footage files, either at the root of the directory or in a specified
|
||||||
|
subdirectory
|
||||||
- Your thumbnail, specifically named `thumbnail.png`
|
- Your thumbnail, specifically named `thumbnail.png`
|
||||||
|
|
||||||
4. Modify your newly-created `metadata.toml` to your liking.
|
4. Modify your newly-created `metadata.toml` to your liking.
|
||||||
|
|
||||||
5. Upload a VOD!
|
5. Upload a VOD!
|
||||||
```sh
|
```sh
|
||||||
# `--deleteAfter` deletes the redundant full VOD export afterwards
|
vodular /path/to/vod
|
||||||
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`.
|
**NOTE:** On first run, you will be prompted to log into YouTube with the
|
||||||
|
channel you wish to upload to. To log out, simply run `vodular --logout`.
|
||||||
|
|
||||||
## VOD Metadata
|
## VOD Metadata
|
||||||
When `--init`ialising a directory, a `metadata.toml` file is created. This is a
|
When `--init`ialising a directory, a `metadata.toml` file is created. This is a
|
||||||
|
|
@ -56,13 +61,12 @@ title = 'Untitled Stream'
|
||||||
part = 0
|
part = 0
|
||||||
# The date of the stream
|
# The date of the stream
|
||||||
date = '2026-01-28'
|
date = '2026-01-28'
|
||||||
# (Optional) Additional tags to add to this VOD's metadata.
|
# (Optional) VOD-specific tags. Added to global tags template.
|
||||||
tags = ['livestream', 'VOD']
|
tags = ['livestream', 'VOD']
|
||||||
# (Optional) Footage directory override, for more complex directory structures.
|
# (Optional) Footage directory override, for more complex directory structures.
|
||||||
footage_dir = 'footage'
|
footage_dir = 'footage'
|
||||||
# Set to `true` by the tool when the VOD has been uploaded successfully.
|
# On successful upload, updated to a URL to the video.
|
||||||
# Prevents future uploads unless `--force` is used.
|
upload_url = false
|
||||||
uploaded = false
|
|
||||||
|
|
||||||
# (Optional) Category details, for additional credits.
|
# (Optional) Category details, for additional credits.
|
||||||
[category]
|
[category]
|
||||||
|
|
|
||||||
45
main.go
45
main.go
|
|
@ -30,11 +30,6 @@ const SEGMENT_EXTENSION = "mkv"
|
||||||
const MAX_TITLE_LEN = 100
|
const MAX_TITLE_LEN = 100
|
||||||
const MAX_DESCRIPTION_LEN = 5000
|
const MAX_DESCRIPTION_LEN = 5000
|
||||||
|
|
||||||
func showHelp() {
|
|
||||||
fmt.Println(helpText)
|
|
||||||
os.Exit(0)
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
|
|
||||||
|
|
@ -65,18 +60,13 @@ func main() {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
// arguments
|
|
||||||
if len(os.Args) < 2 || os.Args[1] == "--help" || os.Args[1] == "-h" {
|
|
||||||
showHelp()
|
|
||||||
}
|
|
||||||
|
|
||||||
var verbose bool = false
|
var verbose bool = false
|
||||||
var initDirectory bool = false
|
var initDirectory bool = false
|
||||||
var logout bool = false
|
var logout bool = false
|
||||||
var keepFullVOD bool = false
|
var keepConcatVOD bool = false
|
||||||
var forceUpload bool = false
|
var forceUpload bool = false
|
||||||
var dryRun bool = false
|
var dryRun bool = false
|
||||||
var directory string = "."
|
var directory string = ""
|
||||||
|
|
||||||
for i, arg := range os.Args {
|
for i, arg := range os.Args {
|
||||||
if i == 0 { continue }
|
if i == 0 { continue }
|
||||||
|
|
@ -86,31 +76,29 @@ func main() {
|
||||||
case "-h":
|
case "-h":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "--help":
|
case "--help":
|
||||||
showHelp()
|
log.Fatal(helpText)
|
||||||
|
|
||||||
case "-v":
|
case "-v":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "--verbose":
|
case "--verbose":
|
||||||
verbose = true
|
verbose = true
|
||||||
|
|
||||||
case "--init":
|
case "--dry-run":
|
||||||
initDirectory = true
|
dryRun = true
|
||||||
|
|
||||||
case "--logout":
|
|
||||||
logout = true
|
|
||||||
|
|
||||||
case "-d":
|
|
||||||
fallthrough
|
|
||||||
case "--keep-vod":
|
|
||||||
keepFullVOD = true
|
|
||||||
|
|
||||||
case "-f":
|
case "-f":
|
||||||
fallthrough
|
fallthrough
|
||||||
case "--force":
|
case "--force":
|
||||||
forceUpload = true
|
forceUpload = true
|
||||||
|
|
||||||
case "--dry-run":
|
case "--init":
|
||||||
dryRun = true
|
initDirectory = true
|
||||||
|
|
||||||
|
case "--keep-vod":
|
||||||
|
keepConcatVOD = true
|
||||||
|
|
||||||
|
case "--logout":
|
||||||
|
logout = true
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fmt.Fprintf(os.Stderr, "Unknown option `%s`\n", arg)
|
fmt.Fprintf(os.Stderr, "Unknown option `%s`\n", arg)
|
||||||
|
|
@ -135,8 +123,7 @@ func main() {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to write config: %v", err)
|
log.Fatalf("Failed to write config: %v", err)
|
||||||
}
|
}
|
||||||
log.Println("Logged out successfully.")
|
log.Fatalf("Logged out successfully.")
|
||||||
os.Exit(0)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialising directory (--init)
|
// initialising directory (--init)
|
||||||
|
|
@ -393,9 +380,9 @@ func main() {
|
||||||
log.Fatalf("Failed to update metadata: %v", err)
|
log.Fatalf("Failed to update metadata: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// delete full VOD after upload, if requested
|
// delete concatenated VOD after upload, unless specified otherwise
|
||||||
// if len(vodFiles) == 1, the full VOD is the *only* VOD. do not delete this!!!
|
// if len(vodFiles) == 1, the full VOD is the *only* VOD. do not delete this!!!
|
||||||
if len(vodFiles) > 1 && !keepFullVOD {
|
if len(vodFiles) > 1 && !keepConcatVOD {
|
||||||
if err = os.Remove(videoMeta.Filepath); err != nil {
|
if err = os.Remove(videoMeta.Filepath); err != nil {
|
||||||
log.Fatalf("Failed to delete full VOD: %v", err)
|
log.Fatalf("Failed to delete full VOD: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,12 @@ USAGE: vodular [options] [directory]
|
||||||
OPTIONS:
|
OPTIONS:
|
||||||
-h, --help: Show this help message.
|
-h, --help: Show this help message.
|
||||||
-v, --verbose: Show verbose logging output.
|
-v, --verbose: Show verbose logging output.
|
||||||
--init: Initialise `directory` as a VOD directory.
|
|
||||||
--logout: Logs out of the current YouTube account.
|
|
||||||
-d, --deleteAfter: Deletes the full VOD after upload.
|
|
||||||
--dry-run: Don't upload or modify any files (Useful with -v)
|
--dry-run: Don't upload or modify any files (Useful with -v)
|
||||||
-f, --force: Force uploading the VOD, even if it already exists.
|
-f, --force: Force uploading the VOD, even if it already exists.
|
||||||
|
--init: Initialise `directory` as a VOD directory.
|
||||||
|
--keep-vod: Retains the concatenated VOD (if generated) after upload.
|
||||||
|
--logout: Logs out of the current YouTube account.
|
||||||
|
|
||||||
SOURCE: https://codeberg.org/arimelody/vodular
|
SOURCE: https://codeberg.org/arimelody/vodular
|
||||||
ISSUES: https://codeberg.org/arimelody/vodular/issues
|
ISSUES: https://codeberg.org/arimelody/vodular/issues
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue