Documentation
¶
Index ¶
- func NewHTTPClient(cfg *config.ScraperSettings, globalProxy *config.ProxyConfig, ...) (*resty.Client, error)
- type LibreDMMConfig
- func (c *LibreDMMConfig) GetDownloadProxy() any
- func (c *LibreDMMConfig) GetMaxRetries() int
- func (c *LibreDMMConfig) GetProxy() any
- func (c *LibreDMMConfig) GetRequestDelay() int
- func (c *LibreDMMConfig) GetUserAgent() string
- func (c *LibreDMMConfig) IsEnabled() bool
- func (c *LibreDMMConfig) ValidateConfig(sc *config.ScraperSettings) error
- type Scraper
- func (s *Scraper) Close() error
- func (s *Scraper) Config() *config.ScraperSettings
- 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) ResolveSearchQuery(input string) (string, bool)
- 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, error)
NewHTTPClient creates a new HTTP client for the LibreDMM scraper. HTTP-01: Per-scraper HTTP client ownership.
Types ¶
type LibreDMMConfig ¶
type LibreDMMConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
RequestDelay int `yaml:"request_delay" json:"request_delay"`
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 LibreDMM scraper configuration. YAML tags are defined here for unmarshaling via config.ScrapersConfig.
func (*LibreDMMConfig) GetDownloadProxy ¶
func (c *LibreDMMConfig) GetDownloadProxy() any
GetDownloadProxy implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) GetMaxRetries ¶
func (c *LibreDMMConfig) GetMaxRetries() int
GetMaxRetries implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) GetProxy ¶
func (c *LibreDMMConfig) GetProxy() any
GetProxy implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) GetRequestDelay ¶
func (c *LibreDMMConfig) GetRequestDelay() int
GetRequestDelay implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) GetUserAgent ¶
func (c *LibreDMMConfig) GetUserAgent() string
GetUserAgent implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) IsEnabled ¶
func (c *LibreDMMConfig) IsEnabled() bool
IsEnabled implements scraperutil.ScraperConfigInterface.
func (*LibreDMMConfig) ValidateConfig ¶
func (c *LibreDMMConfig) ValidateConfig(sc *config.ScraperSettings) error
ValidateConfig implements config.ConfigValidator for LibreDMMConfig.
type Scraper ¶
type Scraper struct {
// contains filtered or unexported fields
}
Scraper implements the LibreDMM scraper.
func New ¶
func New(settings config.ScraperSettings, globalProxy *config.ProxyConfig, globalFlareSolverr config.FlareSolverrConfig) *Scraper
New creates a new LibreDMM scraper.
func (*Scraper) Config ¶
func (s *Scraper) Config() *config.ScraperSettings
Config returns the scraper's configuration
func (*Scraper) ResolveDownloadProxyForHost ¶
func (s *Scraper) ResolveDownloadProxyForHost(host string) (*config.ProxyConfig, *config.ProxyConfig, bool)
ResolveDownloadProxyForHost declares LibreDMM-owned media hosts for downloader proxy routing.
func (*Scraper) ResolveSearchQuery ¶
ResolveSearchQuery prioritizes this scraper when the input is a LibreDMM URL.
func (*Scraper) Search ¶
func (s *Scraper) Search(id string) (*models.ScraperResult, error)
Search scrapes metadata from LibreDMM JSON endpoints.
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.