yggtorrent

package module
v0.0.0-...-85a4a52 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

README

go-yggtorrent-parser

YggTorrent HTML search results parser. Works well with FlareSolverr. Used with https://github.com/SkYNewZ/go-flaresolverr.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category int

Category describes a main category.

const (
	Video Category = iota // 2145
)

func (Category) String

func (i Category) String() string

type Client

type Client interface {
	// ParseResults read given HTML data to search for torrents results.
	ParseResults(data io.Reader) ([]*Result, error)
	// SearchURL makes a YggTorrent search URL ready to be used through flaresolverr.
	SearchURL(query string, category Category, subcategory SubCategory) string
}

Client interface describes wrapped YggTorrent client.

func New

func New(baseURL string) Client

New creates a new YggTorrent client.

type Result

type Result struct {
	ID          string    `json:"id"`
	Name        string    `json:"name"`
	PublishedAt time.Time `json:"published_at"`
	Size        string    `json:"size"`
	Seeders     uint      `json:"seeders"`
	Leechers    uint      `json:"leechers"`
	InfoURL     string    `json:"uri"`
	DownloadURL string    `json:"download_url"`
}

Result is a search result.

type SubCategory

type SubCategory int

SubCategory describes a sub category with a Category.

const (
	Movie SubCategory = iota // 2183
	TV                       // 2184
)

func (SubCategory) String

func (i SubCategory) String() string

Jump to

Keyboard shortcuts

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