nexusphp

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SELECTOR_TORRENT               = `a[href^="download.php?"],a[href^="download?"]`
	SELECTOR_DOWNLOAD_LINK         = `a[href^="download.php?"],a[href^="download?"]`
	SELECTOR_DETAILS_LINK          = `a[href^="details.php?"],a[href^="details_"]`
	SELECTOR_TORRENTS_LIST_DEFAULT = `table.torrents > tbody`
	// xiaomlove/nexusphp paid torrent feature.
	// see https://github.com/xiaomlove/nexusphp/blob/php8/app/Repositories/TorrentRepository.php .
	// function getPaidIcon.
	SELECTOR_TORRENT_PAID = `span[title="收费种子"],span[title="收費種子"],span[title="Paid torrent"]`
	// skip NP download notice. see https://github.com/xiaomlove/nexusphp/blob/php8/public/download.php
	LETDOWN_QUERYSTRING = "letdown=1"
)
View Source
const (
	DEFAULT_TORRENTS_URL = "torrents.php"
)

Variables

This section is empty.

Functions

func NewSite

func NewSite(name string, siteConfig *config.SiteConfigStruct, config *config.ConfigStruct) (site.Site, error)

Types

type Site

type Site struct {
	Name        string
	Location    *time.Location
	SiteConfig  *config.SiteConfigStruct
	Config      *config.ConfigStruct
	HttpClient  *azuretls.Session
	HttpHeaders [][]string
	// contains filtered or unexported fields
}

func (*Site) DownloadTorrent

func (npclient *Site) DownloadTorrent(torrentUrl string) (content []byte, filename string, id string, err error)

If torrentUrl is (seems) a torrent download url, direct use it. Otherwise try to parse torrent id from it and download torrent from id

func (*Site) DownloadTorrentById

func (npclient *Site) DownloadTorrentById(id string) ([]byte, string, error)

func (*Site) GetAllTorrents

func (npclient *Site) GetAllTorrents(sort string, desc bool, pageMarker string, baseUrl string) (torrents []site.Torrent, nextPageMarker string, err error)

func (*Site) GetDefaultHttpHeaders added in v0.1.9

func (npclient *Site) GetDefaultHttpHeaders() [][]string

func (*Site) GetLatestTorrents

func (npclient *Site) GetLatestTorrents(full bool) ([]site.Torrent, error)

func (*Site) GetName

func (npclient *Site) GetName() string

func (*Site) GetSiteConfig

func (npclient *Site) GetSiteConfig() *config.SiteConfigStruct

func (*Site) GetStatus

func (npclient *Site) GetStatus() (*site.Status, error)

func (*Site) PurgeCache

func (npclient *Site) PurgeCache()

func (*Site) SearchTorrents

func (npclient *Site) SearchTorrents(keyword string, baseUrl string) ([]site.Torrent, error)

type TorrentsParserOption

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

Jump to

Keyboard shortcuts

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