ottscanner

package module
v0.0.0-...-8866e2c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: MIT Imports: 15 Imported by: 0

README

ottscanner

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContentFormat

type ContentFormat byte
const (
	HLS ContentFormat = iota
	DASH
)

type ILogger

type ILogger interface {
	Debug(value ...any)
	Debugf(message string, value ...any)
	Info(value ...any)
	Infof(message string, value ...any)
}

func NewTestingLogger

func NewTestingLogger(enabled bool) ILogger

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

func New

func New(url string, maxConcurrency int64) (*Scanner, error)

func (*Scanner) Download

func (s *Scanner) Download(directory string, maxConcurrency int64) error

Download downloads the segments and stores the ABR stream names and their corresponding segments. Retrieve the stream names and the downloaded file locations by calling scanner.Files().

func (*Scanner) EmulatePlayback

func (s *Scanner) EmulatePlayback() error

TODO EmulatePlayback will select a stream then download segments in a buffer from the live edge.

func (*Scanner) Files

func (s *Scanner) Files() map[string][]SegmentDownload

Files returns a map of stream name and the corresponding segment file locations for that steam.

func (*Scanner) Random

func (s *Scanner) Random() error

TODO Random downloads segments randomly

func (*Scanner) Scan

func (s *Scanner) Scan() (map[Segment]bool, error)

Scan will do a head request on each segment and verify 200 response code and return a map of the segment scanned and if it was scanned successfully.

func (*Scanner) Segments

func (s *Scanner) Segments() (Segments, error)

Segments returns a slice of segment urls

func (*Scanner) Streams

func (s *Scanner) Streams() (Streams, error)

Streams returns a map of stream name and url

type Segment

type Segment struct {
	// contains filtered or unexported fields
}

func (*Segment) Name

func (s *Segment) Name() string

func (*Segment) ToJSON

func (s *Segment) ToJSON() ([]byte, error)

func (*Segment) ToString

func (s *Segment) ToString() string

func (*Segment) URL

func (s *Segment) URL() string

type SegmentDownload

type SegmentDownload struct {
	// contains filtered or unexported fields
}

func (*SegmentDownload) Error

func (sd *SegmentDownload) Error() error

func (*SegmentDownload) File

func (sd *SegmentDownload) File() string

type Segments

type Segments []Segment

type Stream

type Stream struct {
	// contains filtered or unexported fields
}

func (*Stream) Name

func (s *Stream) Name() string

func (*Stream) ToJSON

func (s *Stream) ToJSON() ([]byte, error)

func (*Stream) ToString

func (s *Stream) ToString() string

type Streams

type Streams []Stream

Streams are playlists for each bitrate

type TestingLogger

type TestingLogger struct {
	// contains filtered or unexported fields
}

func (*TestingLogger) Debug

func (tl *TestingLogger) Debug(value ...any)

func (*TestingLogger) Debugf

func (tl *TestingLogger) Debugf(message string, value ...any)

func (*TestingLogger) Info

func (tl *TestingLogger) Info(value ...any)

func (*TestingLogger) Infof

func (tl *TestingLogger) Infof(message string, value ...any)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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