javstash

package
v0.2.4-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 18 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 JavStash scraper. HTTP-01: Per-scraper HTTP client ownership. Uses builder pattern for consistent HTTP client construction.

Types

type GraphQLRequest

type GraphQLRequest struct {
	Query         string                 `json:"query"`
	Variables     map[string]interface{} `json:"variables,omitempty"`
	OperationName string                 `json:"operationName,omitempty"`
}

type GraphQLResponse

type GraphQLResponse struct {
	Data struct {
		SearchScene []Scene `json:"searchScene"`
	} `json:"data"`
	Errors []struct {
		Message string `json:"message"`
	} `json:"errors,omitempty"`
}

type Image

type Image struct {
	ID  string `json:"id"`
	URL string `json:"url"`
}

type JavstashConfig

type JavstashConfig struct {
	Enabled       bool                `yaml:"enabled" json:"enabled"`
	APIKey        string              `yaml:"api_key" json:"api_key"`
	BaseURL       string              `yaml:"base_url" json:"base_url"`
	Language      string              `yaml:"language" json:"language"`
	RequestDelay  int                 `yaml:"request_delay" json:"request_delay"`
	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"`
}

func (*JavstashConfig) GetDownloadProxy

func (c *JavstashConfig) GetDownloadProxy() any

func (*JavstashConfig) GetMaxRetries

func (c *JavstashConfig) GetMaxRetries() int

func (*JavstashConfig) GetProxy

func (c *JavstashConfig) GetProxy() any

func (*JavstashConfig) GetRequestDelay

func (c *JavstashConfig) GetRequestDelay() int

func (*JavstashConfig) GetUserAgent

func (c *JavstashConfig) GetUserAgent() string

func (*JavstashConfig) IsEnabled

func (c *JavstashConfig) IsEnabled() bool

func (*JavstashConfig) ValidateConfig

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

type Performer

type Performer struct {
	Performer struct {
		ID   string `json:"id"`
		Name string `json:"name"`
	} `json:"performer"`
}

type Scene

type Scene struct {
	ID          string      `json:"id"`
	Code        string      `json:"code"`
	Title       string      `json:"title"`
	ReleaseDate string      `json:"release_date"`
	Duration    int         `json:"duration"`
	Director    string      `json:"director"`
	Details     string      `json:"details"`
	Studio      *Studio     `json:"studio"`
	Performers  []Performer `json:"performers"`
	Tags        []Tag       `json:"tags"`
	Images      []Image     `json:"images"`
	URLs        []URL       `json:"urls"`
}

type Scraper

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

func New

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

func (*Scraper) CanHandleURL

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

func (*Scraper) Close

func (s *Scraper) Close() error

func (*Scraper) Config

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

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

func (*Scraper) Name

func (s *Scraper) Name() string

func (*Scraper) ScrapeURL

func (s *Scraper) ScrapeURL(rawURL string) (*models.ScraperResult, error)

func (*Scraper) Search

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

func (*Scraper) ValidateConfig

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

type Studio

type Studio struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type Tag

type Tag struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type URL

type URL struct {
	URL string `json:"url"`
}

Jump to

Keyboard shortcuts

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