javbus

package
v0.2.8-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTPClient

func NewHTTPClient(cfg *config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) (*resty.Client, error)

NewHTTPClient creates a new HTTP client for the JavBus scraper. HTTP-01: Per-scraper HTTP client ownership.

Types

type JavBusConfig

type JavBusConfig struct {
	Enabled       bool                      `yaml:"enabled" json:"enabled"`
	Language      string                    `yaml:"language" json:"language"`
	RequestDelay  int                       `yaml:"request_delay" json:"request_delay"`
	MaxRetries    int                       `yaml:"max_retries" json:"max_retries"`
	BaseURL       string                    `yaml:"base_url" json:"base_url"`
	UserAgent     string                    `yaml:"user_agent" json:"user_agent"`
	Proxy         *config.ProxyConfig       `yaml:"proxy,omitempty" json:"proxy,omitempty"`
	DownloadProxy *config.ProxyConfig       `yaml:"download_proxy,omitempty" json:"download_proxy,omitempty"`
	Priority      int                       `yaml:"priority" json:"priority"` // Scraper's priority (higher = higher priority)
	FlareSolverr  config.FlareSolverrConfig `yaml:"flaresolverr" json:"flaresolverr"`
}

Config holds JavBus scraper configuration. YAML tags are defined here for unmarshaling via config.ScrapersConfig.

func (*JavBusConfig) GetDownloadProxy

func (c *JavBusConfig) GetDownloadProxy() any

GetDownloadProxy implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) GetMaxRetries

func (c *JavBusConfig) GetMaxRetries() int

GetMaxRetries implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) GetProxy

func (c *JavBusConfig) GetProxy() any

GetProxy implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) GetRequestDelay

func (c *JavBusConfig) GetRequestDelay() int

GetRequestDelay implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) GetUserAgent

func (c *JavBusConfig) GetUserAgent() string

GetUserAgent implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) IsEnabled

func (c *JavBusConfig) IsEnabled() bool

IsEnabled implements scraperutil.ScraperConfigInterface.

func (*JavBusConfig) ValidateConfig

func (c *JavBusConfig) ValidateConfig(sc *config.ScraperSettings) error

ValidateConfig implements config.ConfigValidator for JavBusConfig.

type Scraper

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

Scraper implements the JavBus scraper.

func New

func New(settings config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) *Scraper

New creates a new JavBus scraper.

func (*Scraper) CanHandleURL

func (s *Scraper) CanHandleURL(rawURL string) bool

GetURL attempts to find a detail URL for the given movie ID.

func (*Scraper) Close

func (s *Scraper) Close() error

Close cleans up resources held by the scraper

func (*Scraper) Config

func (s *Scraper) Config() *config.ScraperSettings

Config returns the scraper's configuration

func (*Scraper) ExtractIDFromURL

func (s *Scraper) ExtractIDFromURL(urlStr string) (string, error)

func (*Scraper) GetURL

func (s *Scraper) GetURL(id string) (string, error)

func (*Scraper) IsEnabled

func (s *Scraper) IsEnabled() bool

IsEnabled returns whether the scraper is enabled.

func (*Scraper) Name

func (s *Scraper) Name() string

Name returns the scraper identifier.

func (*Scraper) ResolveDownloadProxyForHost

func (s *Scraper) ResolveDownloadProxyForHost(host string) (*config.ProxyConfig, *config.ProxyConfig, bool)

ResolveDownloadProxyForHost declares JavBus-owned media hosts for downloader proxy routing.

func (*Scraper) ScrapeURL

func (s *Scraper) ScrapeURL(ctx context.Context, url string) (*models.ScraperResult, error)

func (*Scraper) Search

func (s *Scraper) Search(ctx context.Context, id string) (*models.ScraperResult, error)

Search searches JavBus for a movie and extracts metadata. Search searches JavBus for a movie and extracts metadata with context support.

func (*Scraper) ValidateConfig

func (s *Scraper) ValidateConfig(cfg *config.ScraperSettings) error

ValidateConfig validates the scraper configuration. Returns error if config is invalid, nil if valid.

Jump to

Keyboard shortcuts

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