Package maya (v1.36.6) [up] [repository]

api.go

cli.go

dash.go

dash_segments.go

downloader.go

drm.go

hls.go

orchestrator.go

Index

Functions

func DownloadDash(streamId string, manifestData *Manifest, optionsData *Options) error
func DownloadHls(streamId string, manifestData *Manifest, optionsData *Options) error
func Get(targetUrl *url.URL, headers map[string]string) (*http.Response, error)

Get performs an HTTP GET request by manually constructing the http.Request

func Post(targetUrl *url.URL, headers map[string]string, body []byte) (*http.Response, error)

Post performs an HTTP POST request by manually constructing the http.Request

func SetProxy(proxiesCsv string) error

SetProxy overrides the global http.DefaultTransport with the proxy routing logic

Types

type Cache

Cache holds the pre-computed OS path for the cache directory.

type Cache struct {
	FullPath string
}

Methods

func (c *Cache) Decode(values ...any) error

Decode reads the XML from the cache directory and populates the structs. It stops and returns an error on the first failure.

func (c *Cache) Encode(values ...any) error

Encode marshals the values and writes them to the cache directory. It stops and returns an error on the first failure.

func (c *Cache) GetFilePath(v any) string

GetFilePath unwraps pointers and builds the absolute string path for the file. Exported so users can manually locate, check, or delete cache files.

func (c *Cache) Setup(dirName string) error

Setup computes the full cache path, creates the directory exactly once, and stores the path in the Cache struct.

type DrmSystem

type DrmSystem int

Constants

const (
	DrmNone DrmSystem = iota
	DrmPlayReady
	DrmWidevine
)

type Flag

Flag holds the metadata and state. AddValue flags populate Value. Add flags only toggle Set to true.

type Flag struct {
	Name     string
	Usage    string
	HasValue bool
	Value    string
	Set      bool
}

Methods

func (f *Flag) ParseInt() (int, error)

ParseInt parses the value as an int.

func (f *Flag) ParseUrl() (*url.URL, error)

ParseUrl parses the value as a *url.URL.

func (f *Flag) String() string

String returns the formatted help text for the flag. It safely handles nil flags by returning an empty string (useful for spacing).

type FlagSet

FlagSet is a flat collection of defined flags. You can append nil to this slice to create visual line breaks in the output.

type FlagSet []*Flag

Methods

func (fs *FlagSet) Add(name string, usage string) *Flag

Add registers a switch flag that does not take a value.

func (fs *FlagSet) AddValue(name string, usage string) *Flag

AddValue registers a flag that requires a value.

func (fs FlagSet) Lookup(name string) *Flag

Lookup returns the Flag with the specified name, or nil if not found.

func (fs FlagSet) Parse() error

Parse loops through os.Args directly and checks against the FlagSet.

func (fs FlagSet) String() string

String returns the formatted help text for this specific set of flags.

type Manifest

type Manifest struct {
	Url  *url.URL
	Body []byte
}

Functions

func ListDash(baseUrl *url.URL) (*Manifest, error)
func ListHls(baseUrl *url.URL) (*Manifest, error)

type Options

type Options struct {
	Threads int
	Drm     DrmSystem
	Device  string
	License func([]byte) ([]byte, error)
}