crawler

package
v2.0.14+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID   string
	Name string
}

Category struct

type Crawler

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

Crawler is an Torrent crawler

func NewCrawler

func NewCrawler(cfg *config.ConfigFile) *Crawler

NewCrawler creates a new torrent crawler

func (*Crawler) GetImage

func (c *Crawler) GetImage(path string) ([]byte, error)

GetImage returns an image

func (*Crawler) GetSubcategories

func (c *Crawler) GetSubcategories(category string) (map[string]string, error)

GetSubcategories returns the subcategories

func (*Crawler) Search

func (c *Crawler) Search(params *SearchParams, page string) (*SearchResult, error)

Search returns a search result

func (*Crawler) SearchOptions

func (c *Crawler) SearchOptions() (*SearchOptions, error)

func (*Crawler) SearchTorrentInfo

func (c *Crawler) SearchTorrentInfo(id string, date string, path string, season string, firstEpisode string, lastEpisode string) (*TorrentInfo, error)

type SearchData

type SearchData struct {
	All      int                            `json:"all"`
	Items    int                            `json:"items"`
	Torrents map[string]map[string]*Torrent `json:"torrents"`
	Total    int                            `json:"total"`
}

func (*SearchData) GetTorrents

func (s *SearchData) GetTorrents() []*Torrent

type SearchOptions

type SearchOptions struct {
	Categoria map[string]string `json:"categorias"`
	Idioma    map[string]string `json:"idiomas"`
	Calidad   map[string]string `json:"calidades"`
	Ordenar   map[string]string `json:"ordenar"`
	Inon      map[string]string `json:"inon"`
}

type SearchParams added in v1.0.0

type SearchParams struct {
	Categoria         string `json:"categoria"`
	CategoriaTexto    string `json:"categoriaTexto"`
	SubCategoria      string `json:"subcategoria"`
	SubCategoriaTexto string `json:"subcategoriaTexto"`
	Calidad           string `json:"calidad"`
	CalidadTexto      string `json:"calidadTexto"`
	Palabras          string `json:"q"`
}

type SearchResult

type SearchResult struct {
	Data    SearchData `json:"data"`
	Success bool       `json:"success"`
}

type Torrent

type Torrent struct {
	Calidad          string `json:"calidad"`
	GUID             string `json:"guid"`
	Imagen           string `json:"imagen"`
	TorrentDateAdded string `json:"torrentDateAdded"`
	TorrentID        string `json:"torrentID"`
	TorrentName      string `json:"torrentName"`
	TorrentSize      string `json:"torrentSize"`
}

func (*Torrent) FirstEpisode

func (t *Torrent) FirstEpisode() string

func (*Torrent) LastEpisode

func (t *Torrent) LastEpisode() string

func (*Torrent) Season

func (t *Torrent) Season() string

type TorrentInfo

type TorrentInfo struct {
	URL      string `json:"url"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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