r18dev

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type R18Response

type R18Response struct {
	DVDID         string `json:"dvd_id"`
	ContentID     string `json:"content_id"`
	TitleJA       string `json:"title_ja"`       // Japanese title
	TitleEn       string `json:"title_en"`       // English title (may be null)
	Description   string `json:"description"`    // Legacy field (not used by current API)
	DescriptionEn string `json:"description_en"` // English description field
	ReleaseDate   string `json:"release_date"`
	Runtime       int    `json:"runtime_mins"` // API uses runtime_mins, not runtime

	// Top-level jacket URLs
	JacketFullURL  string `json:"jacket_full_url"`
	JacketThumbURL string `json:"jacket_thumb_url"`

	// Gallery/screenshots
	Gallery []struct {
		ImageFull  string `json:"image_full"`
		ImageThumb string `json:"image_thumb"`
	} `json:"gallery"`

	// Sample video URL
	SampleURL string `json:"sample_url"`

	// Director is now a simple string
	Director   string `json:"director"`
	DirectorEn string `json:"director_en"` // New English director field

	// Maker - support both nested and flat structures
	Maker struct {
		Name string `json:"name"`
	} `json:"maker"`
	MakerNameEn string `json:"maker_name_en"` // New flat English field

	// Label - support both nested and flat structures
	Label struct {
		Name string `json:"name"`
	} `json:"label"`
	LabelNameEn string `json:"label_name_en"` // New flat English field

	// Series can be nested object or string
	Series struct {
		Name string `json:"name"`
	} `json:"series"`
	SeriesName   string `json:"series_name"`    // Fallback
	SeriesNameEn string `json:"series_name_en"` // New English series field

	// Categories with simple name field
	Categories []struct {
		Name string `json:"name"`
	} `json:"categories"`

	// Actresses with detailed fields
	Actresses []struct {
		ID         int    `json:"id"`
		ImageURL   string `json:"image_url"`
		NameKana   string `json:"name_kana"`
		NameKanji  string `json:"name_kanji"`
		NameRomaji string `json:"name_romaji"`
	} `json:"actresses"`

	// Images are now nested differently
	Images struct {
		JacketImage struct {
			Large  string `json:"large"`
			Large2 string `json:"large2"`
		} `json:"jacket_image"`
		SampleImages []string `json:"sample_images"`
	} `json:"images"`

	// Sample/trailer
	Sample struct {
		High string `json:"high"`
		Low  string `json:"low"`
	} `json:"sample"`
}

R18Response represents the JSON response from R18.dev API (current format)

type Scraper

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

Scraper implements the R18.dev scraper

func New

func New(cfg *config.Config) *Scraper

New creates a new R18.dev scraper

func (*Scraper) GetURL

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

GetURL constructs the URL for a given movie ID

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 R18.dev-owned media hosts for downloader proxy routing.

func (*Scraper) Search

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

Search searches for and scrapes metadata for a given movie ID

Jump to

Keyboard shortcuts

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