ao3

package module
v0.0.0-...-6756b6c Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 21 Imported by: 0

README

ao3

cli tool for scraping archiveofourown

Documentation

Index

Constants

View Source
const (
	Title        = `h2.title`
	Author       = `h3.byline a`
	Series       = `dd.series .position`
	Comments     = `.preface .summary .userstuff`
	Ships        = `dd.relationship a`
	Tags         = `dd.freeform a`
	Fandom       = `dd.fandom a`
	Pubdate      = `dd.published`
	ListLink     = `li.work h4.heading a:first-of-type`
	RelatedWorks = `ul.associations li a`
	Downloads    = `li.download ul li a`
)

Variables

View Source
var NoTitleErr = errors.New("no title")

Functions

func Cookies

func Cookies() []*http.Cookie

func CurrentURL

func CurrentURL() string

func DontSave

func DontSave() bool

func DownloadWork

func DownloadWork(u, name string)

func Encode

func Encode() string

func Formats

func Formats() []string

func GetAllNodes

func GetAllNodes(sel string, nodes *[]*cdp.Node) chromedp.Action

func GetInnerHTML

func GetInnerHTML(sel string, val *string) chromedp.Action
func GetLinkList(ctx context.Context, u string) []string

func GetNodes

func GetNodes(sel string, nodes *[]*cdp.Node) chromedp.Action

func GetString

func GetString(sel string, val *string) chromedp.Action

func GetWork

func GetWork(ctx context.Context, u string) (cdb.Book, error)

func IsPodfic

func IsPodfic() bool

func NoDownloads

func NoDownloads() bool

func Page

func Page(u string) ([]cdb.Book, error)

func ParseUrl

func ParseUrl(u string) *url.URL

func Scrape

func Scrape(u string) ([]cdb.Book, error)
func Search(u string) ([]cdb.Book, error)

func SearchParams

func SearchParams() []string

func SortAndFilter

func SortAndFilter(u string) ([]cdb.Book, error)

func SortAndFilterParams

func SortAndFilterParams() []string

Types

type Host

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

func ParseHost

func ParseHost(hs string) (*Host, error)

func (*Host) Domain

func (h *Host) Domain(s string) *Host

func (Host) String

func (h Host) String() string

func (*Host) SubDomain

func (h *Host) SubDomain(s string) *Host

func (*Host) TLD

func (h *Host) TLD(s string) *Host

type Path

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

type Query

type Query struct {
	URI     string
	ID      string
	IsAudio bool
	Query   url.Values

	*url.URL
	*Host
	// contains filtered or unexported fields
}

func New

func New(uri ...string) *Query

func ParseURL

func ParseURL(uri string) *Query

func (*Query) AddParam

func (q *Query) AddParam(name, val string) *Query

func (*Query) AppendPath

func (q *Query) AppendPath(paths ...string) *Query

func (*Query) PrependPath

func (q *Query) PrependPath(path string) *Query

func (*Query) SetHost

func (q *Query) SetHost(host string) *Query

func (*Query) SetParam

func (q *Query) SetParam(name, val string) *Query

func (*Query) String

func (q *Query) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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