provider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrMediaNotSupported added in v1.0.0

func IsErrMediaNotSupported(err error) bool

IsErrMediaNotSupported return true if the error dictates taht the media type was not supported by the scraper

func Subscene

func Subscene() types.Provider

Subscene interfaces with subscene.com for downloading subtitles

func TheMovieDB added in v1.0.0

func TheMovieDB(token string) types.Scraper

TheMovieDB is a scraper for themoviedb.org

func TheTVDB added in v1.0.0

func TheTVDB(key string) types.Scraper

TheTVDB is a scraper for thetvdb.com

Types

type APIClient added in v1.0.0

type APIClient struct {
	*http.Client
	ratelimit.Limiter
	// contains filtered or unexported fields
}

APIClient is a http client with rate limiting

func NewAPIClient added in v1.0.0

func NewAPIClient(name string, limit int) *APIClient

NewAPIClient return a new APIClient

func (*APIClient) Do added in v1.0.0

func (a *APIClient) Do(req *http.Request) (*http.Response, error)

Do performs a http request with rate limiting

func (*APIClient) Get added in v1.0.0

func (a *APIClient) Get(url string) (*http.Response, error)

Get performs a http get request with rate limiting

func (*APIClient) Head added in v1.0.0

func (a *APIClient) Head(url string) (*http.Response, error)

Head performs a http head request with rate limiting

func (*APIClient) Post added in v1.0.0

func (a *APIClient) Post(url string, contentType string, body io.Reader) (*http.Response, error)

Post performs a http post request with rate limiting

func (*APIClient) PostForm added in v1.0.0

func (a *APIClient) PostForm(url string, data url.Values) (*http.Response, error)

PostForm performs a http post form request with rate limiting

type ErrMediaNotSupported added in v1.0.0

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

ErrMediaNotSupported is an error for unsupported media

Jump to

Keyboard shortcuts

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