eztv

package module
v0.0.0-...-039613c Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 8 Imported by: 1

README

EZTV API client

GoDoc Go Report Card

This is a wrapper around the EZTV API written in go.

Usage

Get all the torrents for a show from its imdb id
torrents, err := eztv.GetShowTorrents("tt2149175")
Get all the torrents of a specific episode
// Get the torrents of the first episode of the second season of tt2085059
torrents, err := GetEpisodeTorrents("tt2085059", 2, 1)
Get the last torrents available
// Get the 20 torrents from the 2 first pages
torrents, err := eztv.GetTorrents(20, 2)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEpisodeNotFound = errors.New("episode not found")
	ErrShowNotFound    = errors.New("show not found")
	ErrInvalidArgument = errors.New("invalid argument")
	ErrMissingArgument = errors.New("missing argument")
)

Eztv errors

Functions

This section is empty.

Types

type EpisodeTorrent

type EpisodeTorrent struct {
	ID              int       `json:"id"`
	Hash            string    `json:"hash"`
	Filename        string    `json:"filename"`
	EpisodeURL      string    `json:"episode_url"`
	TorrentURL      string    `json:"torrent_url"`
	MagnetURL       string    `json:"magnet_url"`
	Title           string    `json:"title"`
	ImdbID          string    `json:"imdb_id"`
	Season          int       `json:"season,string"`
	Episode         int       `json:"episode,string"`
	SmallScreenshot string    `json:"small_screenshot"`
	LargeScreenshot string    `json:"large_screenshot"`
	Seeds           int       `json:"seeds"`
	Peers           int       `json:"peers"`
	DateReleased    time.Time `json:"date_released_unix"`
	Size            uint      `json:"size_bytes,string"`
}

EpisodeTorrent represents a torrent for an episode

func GetEpisodeTorrents

func GetEpisodeTorrents(ImdbID string, season, episode int) ([]*EpisodeTorrent, error)

GetEpisodeTorrents will get the torrents of show's episode from an ImdbID, a season number and an episode number

func GetShowTorrents

func GetShowTorrents(imdbID string) ([]*EpisodeTorrent, error)

GetShowTorrents will get the torrents of a show from an ImdbID

func GetTorrents

func GetTorrents(limit, page int) ([]*EpisodeTorrent, error)

GetTorrents will get torrents, given a limit and a page number

func (*EpisodeTorrent) UnmarshalJSON

func (t *EpisodeTorrent) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the Unmarshaller interface

Jump to

Keyboard shortcuts

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