provider

package
v0.0.0-...-08219f7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Addic7ed

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

func NewAddic7ed

func NewAddic7ed(username, password string) *Addic7ed

func (*Addic7ed) Download

func (a *Addic7ed) Download(ctx context.Context, sub *Subtitle) (io.ReadCloser, error)

func (*Addic7ed) Name

func (a *Addic7ed) Name() string

func (*Addic7ed) Query

func (a *Addic7ed) Query(ctx context.Context, q string) ([]*Subtitle, error)

func (*Addic7ed) QueryType

func (a *Addic7ed) QueryType() QueryItem

type Provider

type Provider interface {
	// Provider name
	Name() string

	// Provider accepts requests with title/hash or what.
	QueryType() QueryItem

	// Query subtitles for the episode
	Query(context.Context, string) ([]*Subtitle, error)

	// Download subtitle
	Download(context.Context, *Subtitle) (io.ReadCloser, error)
}

type QueryItem

type QueryItem int
const (
	QueryByTitle QueryItem = iota
	QueryByHash
)

type Subtitle

type Subtitle struct {
	Title           string
	Season          int
	Episode         int
	Language        string
	Release         string
	Status          string
	HearingImpaired bool
	DownloadURL     string
	PageURL         string
}

func (*Subtitle) String

func (s *Subtitle) String() string

Jump to

Keyboard shortcuts

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