Added ability to add CloudFlare Cookie

This commit is contained in:
HeapOfChaos 2025-03-23 02:03:40 -04:00 committed by GitHub
parent 866435d061
commit 0dd2f66a74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,6 @@ import (
"encoding/json"
"errors"
"os"
"github.com/google/uuid"
"github.com/urfave/cli/v2"
)
@ -32,6 +31,8 @@ type Config struct {
SplitDuration int
SplitFilesize int
Interval int
CFCookie string
UserAgent string
}
// Manager
@ -39,10 +40,12 @@ type Manager struct {
cli *cli.Context
Channels map[string]*Channel
Updates map[string]chan *Update
}
// NewManager
func NewManager(c *cli.Context) *Manager {
return &Manager{
cli: c,
Channels: map[string]*Channel{},
@ -101,6 +104,8 @@ func (m *Manager) CreateChannel(conf *Config) error {
Resolution: conf.Resolution,
ResolutionFallback: conf.ResolutionFallback,
Interval: conf.Interval,
CFCookie: m.cli.String("cf-cookie"),
UserAgent: m.cli.String("user-agent"),
LastStreamedAt: "-",
SegmentDuration: 0,
SplitDuration: conf.SplitDuration,