Documentation
¶
Index ¶
- Variables
- func NewHTTPClient(cfg *config.ScraperSettings, globalProxy *config.ProxyConfig, ...) (*resty.Client, *httpclient.FlareSolverr, error)
- type JavLibraryConfig
- func (c *JavLibraryConfig) GetDownloadProxy() any
- func (c *JavLibraryConfig) GetMaxRetries() int
- func (c *JavLibraryConfig) GetProxy() any
- func (c *JavLibraryConfig) GetRequestDelay() int
- func (c *JavLibraryConfig) GetUserAgent() string
- func (c *JavLibraryConfig) IsEnabled() bool
- func (c *JavLibraryConfig) ValidateConfig(sc *config.ScraperSettings) error
- type Scraper
- func (s *Scraper) Close() error
- func (s *Scraper) Config() *config.ScraperSettings
- func (s *Scraper) GetLanguage() string
- func (s *Scraper) GetURL(id string) (string, error)
- func (s *Scraper) IsEnabled() bool
- func (s *Scraper) Name() string
- func (s *Scraper) ResolveDownloadProxyForHost(host string) (*config.ProxyConfig, *config.ProxyConfig, bool)
- func (s *Scraper) Search(id string) (*models.ScraperResult, error)
- func (s *Scraper) ValidateConfig(cfg *config.ScraperSettings) error
Constants ¶
This section is empty.
Variables ¶
var SupportedLanguages = []string{"en", "ja", "cn", "tw"}
SupportedLanguages lists the language codes supported by JavLibrary. en = English, ja = Japanese, cn = Chinese (Simplified), tw = Chinese (Traditional)
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(cfg *config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) (*resty.Client, *httpclient.FlareSolverr, error)
NewHTTPClient creates an HTTP client and FlareSolverr for the javlibrary scraper. HTTP-01, HTTP-03: Per-scraper HTTP client and FlareSolverr ownership. Checks cfg.UseFlareSolverr to determine whether to enable FlareSolverr. Returns client, flaresolverr, and error.
Types ¶
type JavLibraryConfig ¶
type JavLibraryConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Language string `yaml:"language" json:"language"`
RequestDelay int `yaml:"request_delay" json:"request_delay"`
BaseURL string `yaml:"base_url" json:"base_url"`
Cookies map[string]string `yaml:"cookies,omitempty" json:"cookies,omitempty"` // For cf_clearance, cf_bm, etc.
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)
}
Config holds JavLibrary scraper configuration. YAML tags are defined here for unmarshaling via config.ScrapersConfig.
func (*JavLibraryConfig) GetDownloadProxy ¶
func (c *JavLibraryConfig) GetDownloadProxy() any
GetDownloadProxy implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) GetMaxRetries ¶
func (c *JavLibraryConfig) GetMaxRetries() int
GetMaxRetries implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) GetProxy ¶
func (c *JavLibraryConfig) GetProxy() any
GetProxy implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) GetRequestDelay ¶
func (c *JavLibraryConfig) GetRequestDelay() int
GetRequestDelay implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) GetUserAgent ¶
func (c *JavLibraryConfig) GetUserAgent() string
GetUserAgent implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) IsEnabled ¶
func (c *JavLibraryConfig) IsEnabled() bool
IsEnabled implements scraperutil.ScraperConfigInterface.
func (*JavLibraryConfig) ValidateConfig ¶
func (c *JavLibraryConfig) ValidateConfig(sc *config.ScraperSettings) error
ValidateConfig implements config.ConfigValidator for JavLibraryConfig.
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper implements the models.Scraper interface for JavLibrary
func New ¶
func New(settings config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) *Scraper
New creates a new JavLibrary scraper.
func (*Scraper) Config ¶
func (s *Scraper) Config() *config.ScraperSettings
Config returns the scraper's configuration
func (*Scraper) GetLanguage ¶
GetLanguage returns the configured language
func (*Scraper) ResolveDownloadProxyForHost ¶
func (s *Scraper) ResolveDownloadProxyForHost(host string) (*config.ProxyConfig, *config.ProxyConfig, bool)
ResolveDownloadProxyForHost declares JavLibrary-owned media hosts for downloader proxy routing.
func (*Scraper) Search ¶
func (s *Scraper) Search(id string) (*models.ScraperResult, error)
Search searches for a movie by ID
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.