Documentation
¶
Index ¶
- func NewHTTPClient(cfg *config.ScraperSettings, globalProxy *config.ProxyConfig, ...) (*resty.Client, *httpclient.FlareSolverr, error)
- type JavDBConfig
- func (c *JavDBConfig) GetDownloadProxy() any
- func (c *JavDBConfig) GetMaxRetries() int
- func (c *JavDBConfig) GetProxy() any
- func (c *JavDBConfig) GetRequestDelay() int
- func (c *JavDBConfig) GetUserAgent() string
- func (c *JavDBConfig) IsEnabled() bool
- func (c *JavDBConfig) ValidateConfig(sc *config.ScraperSettings) error
- type Scraper
- func (s *Scraper) CanHandleURL(rawURL string) bool
- func (s *Scraper) Close() error
- func (s *Scraper) Config() *config.ScraperSettings
- func (s *Scraper) ExtractIDFromURL(urlStr string) (string, error)
- 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) ScrapeURL(urlStr string) (*models.ScraperResult, error)
- func (s *Scraper) Search(id string) (*models.ScraperResult, error)
- func (s *Scraper) ValidateConfig(cfg *config.ScraperSettings) error
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, *httpclient.FlareSolverr, error)
NewHTTPClient creates an HTTP client and FlareSolverr for the JavDB scraper. HTTP-01, HTTP-03: Per-scraper HTTP client and FlareSolverr ownership. Uses builder pattern for consistent HTTP client construction. Returns client, flaresolverr, and error.
Types ¶
type JavDBConfig ¶
type JavDBConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
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"` // FlareSolverr config for Cloudflare bypass
}
Config holds JavDB scraper configuration. YAML tags are defined here for unmarshaling via config.ScrapersConfig.
func (*JavDBConfig) GetDownloadProxy ¶
func (c *JavDBConfig) GetDownloadProxy() any
GetDownloadProxy implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) GetMaxRetries ¶
func (c *JavDBConfig) GetMaxRetries() int
GetMaxRetries implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) GetProxy ¶
func (c *JavDBConfig) GetProxy() any
GetProxy implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) GetRequestDelay ¶
func (c *JavDBConfig) GetRequestDelay() int
GetRequestDelay implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) GetUserAgent ¶
func (c *JavDBConfig) GetUserAgent() string
GetUserAgent implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) IsEnabled ¶
func (c *JavDBConfig) IsEnabled() bool
IsEnabled implements scraperutil.ScraperConfigInterface.
func (*JavDBConfig) ValidateConfig ¶
func (c *JavDBConfig) ValidateConfig(sc *config.ScraperSettings) error
ValidateConfig implements config.ConfigValidator for JavDBConfig.
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper implements the JavDB scraper.
func New ¶
func New(settings config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) *Scraper
New creates a new JavDB scraper.
func (*Scraper) CanHandleURL ¶
CanHandleURL returns true if this scraper can handle the given URL
func (*Scraper) Config ¶
func (s *Scraper) Config() *config.ScraperSettings
Config returns the scraper's configuration
func (*Scraper) ExtractIDFromURL ¶
ExtractIDFromURL extracts the movie ID from a JavDB URL
func (*Scraper) ResolveDownloadProxyForHost ¶
func (s *Scraper) ResolveDownloadProxyForHost(host string) (*config.ProxyConfig, *config.ProxyConfig, bool)
ResolveDownloadProxyForHost declares JavDB-owned media hosts for downloader proxy routing.
func (*Scraper) ScrapeURL ¶
func (s *Scraper) ScrapeURL(urlStr string) (*models.ScraperResult, error)
ScrapeURL directly scrapes metadata from a JavDB URL. This provides more accurate results than ID-based search when the exact URL is known.
func (*Scraper) Search ¶
func (s *Scraper) Search(id string) (*models.ScraperResult, error)
Search looks up a movie by ID and scrapes metadata.
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.