Skip to content

Latest commit

 

History

History
57 lines (50 loc) · 960 Bytes

README.md

File metadata and controls

57 lines (50 loc) · 960 Bytes

GO client for EZTV API

This package provides a simple API client for to the public EZTV API.


Download

go get github.com/PauliusLozys/eztv

Example usage

package main

import (
	"context"
	"fmt"

	"github.com/PauliusLozys/eztv"
)

func main() {
	client := eztv.New() // Create new client
	page, err := client.GetTorrents(context.TODO(), eztv.URLOptions{
		Limit:  10,
		Page:   1,
		ImdbID: "0944947",
	})
	if err != nil {
		panic(err)
	}
	for _, t := range page.Torrents {
		fmt.Println(t.Title)
	}
}

Example torrent stream usage

package main

import (
	"context"
	"fmt"

	"github.com/PauliusLozys/eztv"
)

func main() {
	client := eztv.New()
	for s := range client.TorrentStream(context.Background(), eztv.StreamOptions{LastTorrentID: 0, ImdbID: "tt7908628"}) {
		if s.Err != nil {
			fmt.Println("Error:", s.Err)
			continue
		}
		fmt.Println(s.Torrent.ID, s.Torrent.Title)
	}
}