dlsite

package module
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package dlsite provides access to DLSite work information.

Example
f, err := dlsite.NewFetcher()
if err != nil {
	panic(err)
}
defer f.Close()
w, err := f.FetchWork("RJ123")
if err != nil {
	panic(err)
}
fmt.Println(w.Title)
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchWorkOption

type FetchWorkOption interface {
	// contains filtered or unexported methods
}

A FetchWorkOption can be passed to FetchWork to configure fetching.

Deprecated; use the FetchWorkDirectly method instead.

func IgnoreCache

func IgnoreCache() FetchWorkOption

IgnoreCache returns an option that ignores the cache when fetching. Updated work information is still added to the cache.

Deprecated; use the FetchWorkDirectly method instead.

type Fetcher

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

A Fetcher can fetch DLSite work information.

func NewFetcher

func NewFetcher(o ...FetcherOption) (*Fetcher, error)

NewFetcher creates a new Fetcher. The Fetcher scrapes DLSite and HVDB for information. The Fetcher keeps a cache in the user's XDG cache directory.

func (*Fetcher) Close

func (f *Fetcher) Close() error

Close closes resources used by the fetcher.

func (*Fetcher) FetchWork

func (f *Fetcher) FetchWork(c codes.WorkCode, o ...FetchWorkOption) (*Work, error)

FetchWork fetches information for a DLSite work.

The FetchWorkOption argument is deprecated; use the FetchWorkDirectly method instead.

func (*Fetcher) FetchWorkDirectly added in v2.1.0

func (f *Fetcher) FetchWorkDirectly(c codes.WorkCode) (*Work, error)

FetchWorkDirectly fetches information for a DLSite work, bypassing any cache. The newly fetched information will still be cached for future FetchWork calls.

type FetcherOption

type FetcherOption interface {
	// contains filtered or unexported methods
}

A FetcherOption can be passed to NewFetcher to configure Fetcher creation.

func CachePath

func CachePath(path string) FetcherOption

CachePath sets the cache path of the Fetcher. If path is empty, no cache file is used.

type Work

type Work struct {
	Code         codes.WorkCode
	Title        string
	EnglishTitle string
	Circle       string
	Series       string
	Description  string
	CVs          []string
	Tags         []string
	SFW          bool
}

A Work contains information about a DLSite work.

Directories

Path Synopsis
cmd
dlsite
Command dlsite provides dlsite utilities.
Command dlsite provides dlsite utilities.
Package codes contains the types for DLSite RJ codes and RE codes.
Package codes contains the types for DLSite RJ codes and RE codes.
internal
caching
Package caching implements a key value caching store.
Package caching implements a key value caching store.
dlsite
Package dlsite provides a Go API for accessing DLSite information.
Package dlsite provides a Go API for accessing DLSite information.
hvdb
Package hvdb provides a Go API for accessing HVDB information.
Package hvdb provides a Go API for accessing HVDB information.

Jump to

Keyboard shortcuts

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