static

package
v1.2.57 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrURLParseFailed defines URL parse failed error.
	ErrURLParseFailed = errors.New("URL parse failed")
	// ErrLoginRequired defines login required error.
	ErrLoginRequired = errors.New("login required")
	// ErrDataSourceParseFailed defines a data source parse error.
	ErrDataSourceParseFailed = errors.New("data source parse failed")
)

Functions

This section is empty.

Types

type Caption

type Caption struct {
	// URL to the subtitles
	URL URL `json:"url"`
	// Language of the caption
	Language string `json:"language"`
}

Caption this includes (CC, OC or Subtitles)

type Data

type Data struct {
	// Site name of the media host
	Site string `json:"site"`
	// Title of data
	Title string `json:"title"`
	// Type of data commonly image or video
	Type DataType `json:"type"`

	// Streams of different quality or mirrors
	Streams map[string]*Stream `json:"streams"`

	// Caption this includes (CC, OC or Subtitles)
	Captions []*Caption `json:"captions"`

	// URL that was supplied to the scraper
	URL string `json:"sourceUrl"`
}

Data Struct of data

type DataType

type DataType string

DataType indicates the type of extracted data, e.g. video or image.

const (
	// DataTypeVideo indicates the type of extracted data is the video.
	DataTypeVideo DataType = "video"
	// DataTypeAudio indicates the type of extracted data is the audio.
	DataTypeAudio DataType = "audio"
	// DataTypeImage indicates the type of extracted data is the image.
	DataTypeImage DataType = "image"
	// DataTypeUnknown indicates the type of extracted data is the unknown.
	DataTypeUnknown DataType = "unknown"
)

type Extractor

type Extractor interface {
	Extract(URL string) ([]*Data, error)
}

Extractor template

type Stream

type Stream struct {
	// Type of stream audio or video
	Type DataType `json:"type"`
	// URLs that together are the stream
	URLs []*URL `json:"urls"`
	// Quality e.g. 2160p, 1080p, 720p ... or 1050x1200 or codec
	Quality string `json:"quality"`
	// Size of stream - fill this if it is a big blob of data and you want to make use of concurrent downloading
	Size int64 `json:"size"`
	// Info that could be interesting for the user
	Info string `json:"info"`
	// Ext after the files are merged
	Ext string `json:"ext"`
	// Key that is needed to decrypt this stream
	Key []byte `json:"key"`
}

Stream Struct of stream

type URL

type URL struct {
	// URL that contains the data to be downloaded
	URL string `json:"url"`
	// Ext of the data
	Ext string `json:"ext"`
}

URL Struct of URL

Jump to

Keyboard shortcuts

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