provider

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2020 License: GPL-3.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrMediaNotSupported

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

func TheMovieDB(token string) types.Scraper

TheMovieDB is a scraper for themoviedb.org

func TheTVDB

func TheTVDB(key string) types.Scraper

TheTVDB is a scraper for thetvdb.com

Types

type APIClient

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

APIClient is a http client with rate limiting

func NewAPIClient

func NewAPIClient(name string, limit int) *APIClient

NewAPIClient return a new APIClient

func (*APIClient) Do

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

Do performs a http request with rate limiting

func (*APIClient) Get

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

Get performs a http get request with rate limiting

func (*APIClient) Head

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

Head performs a http head request with rate limiting

func (*APIClient) Post

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

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

PostForm performs a http post form request with rate limiting

type ErrMediaNotSupported

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