Categorygithub.com/DggHQ/dggarchiver-uploader
repositorypackage
0.0.0-20231109104942-66dab85e68ae
Repository: https://github.com/dgghq/dggarchiver-uploader.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

dggarchiver-uploader

This is the uploader service of the dggarchiver service that uploads the recorded livestreams.

Features

  1. Supported video platforms:
    • LBRY/Odysee
  2. Adds the uploaded livestreams to an SQLite database
  3. Broadcasts current livestream upload progress via Prometheus
  4. Lua plugin support

Lua

The service can be extended with Lua plugins/scripts. An example can be found in the uploader.example.lua file.

If enabled, the service will call these functions from the specified .lua file:

  • OnReceive(vod) when a livestream recording is received, where vod is the livestream struct
  • OnProgress(progressPercentage) when upload progress is updated, where progressPercentage is the percentage number
  • OnFinish(vod, success) when a livestream recording is uploaded, where vod is the livestream struct, and success is the boolean signifying success
  • OnInsert(vod, success) when a livestream recording has been added to the SQLite database, where vod is the livestream struct, and success is the boolean signifying success

After the functions are done executing, the service will check the global ReceiveResponse, ProgressResponse, FinishResponse and InsertResponse variables for errors, before returning the struct. The struct's fields are:

type LuaResponse struct {
	Filled  bool
	Error   bool
	Message string
	Data    map[string]interface{}
}

Configuration

The config file location can be set with the CONFIG environment variable. Example configuration can be found below and in the config.example.yaml file.

uploader:
  lbry:
    uri: https://example.com/ # lbry-sdk server uri
    author: example # author name to set for livestreams
    channel_name: example # channel to upload the livestreams to
  sqlite: 
    uri: example.sqlite # path to the SQLite database
  plugins:
    enabled: no
    path: uploader.lua # path to the lua plugin
  verbose: no # increases log verbosity

nats:
  host: nats # nats uri
  topic: archiver # main nats topic