hls

package module
v0.0.0-...-237567d Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 13 Imported by: 0

README

🔦⚫️ crawly-live-hls

An HLS (M3U8) livestream monitor.

Depends on rubpy/crawly.

Example

An interactive example can be found here: example/example.go.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NilConfig = errors.New("config is nil")
	NilClient = errors.New("client is nil")
)
View Source
var (
	InvalidStreamURL = errors.New("invalid stream URL")

	HLSUnexpectedResponse = errors.New("unexpected HLS response")
)

Functions

func IsValidStreamURL

func IsValidStreamURL(streamURL string) (valid bool)

Types

type ConfigOption

type ConfigOption func(cfg *config)

func WithClient

func WithClient(client cclient.Client) ConfigOption

func WithLogger

func WithLogger(logger *slog.Logger) ConfigOption

func WithSettings

func WithSettings(settings CrawlerSettings) ConfigOption

type Crawler

type Crawler struct {
	crawly.Crawler
	// contains filtered or unexported fields
}

func NewCrawler

func NewCrawler(opts ...ConfigOption) (*Crawler, error)

func (*Crawler) CheckHLS

func (cr *Crawler) CheckHLS(ctx context.Context, streamURL string) (available bool, err error)

func (*Crawler) SetSettings

func (cr *Crawler) SetSettings(settings CrawlerSettings)

func (*Crawler) Settings

func (cr *Crawler) Settings() CrawlerSettings

type CrawlerSettings

type CrawlerSettings struct {
	crawly.CrawlerSettings
}

type EntityData

type EntityData struct {
	Live bool `json:"live"`
}

type Handle

type Handle struct {
	Type  HandleType
	Value string
}

func StreamURL

func StreamURL(streamURL string) Handle

func (Handle) Equal

func (h Handle) Equal(handle crawly.Handle) bool

func (Handle) String

func (h Handle) String() string

func (Handle) Valid

func (h Handle) Valid() bool

type HandleType

type HandleType uint
const (
	HandleStreamURL HandleType = (iota + 1)
)

func (HandleType) String

func (ht HandleType) String() string

type M3UPlaylist

type M3UPlaylist struct {
	HasStartTag   bool
	HasVersionTag bool

	HasError               bool
	HasIndependentSegments bool
	HasStreamInf           bool
	HasIFrameStreamInf     bool
	HasMedia               bool
}

type OrderData

type OrderData struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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