audible

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 16 Imported by: 0

README

urmeta

scrape book metadata

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsinFromPath

func AsinFromPath(path string) (string, error)

func MarketFromHost

func MarketFromHost(host string) string

Types

type Chapter

type Chapter struct {
	Length    int    `json:"length_ms"`
	StartMs   int    `json:"start_offset_ms"`
	ChapTitle string `json:"title"`
}

func (Chapter) End

func (c Chapter) End() time.Duration

func (Chapter) Start

func (c Chapter) Start() time.Duration

func (Chapter) Title

func (c Chapter) Title() string

type ChapterInfo

type ChapterInfo struct {
	IntroDurationMs int       `json:"brandIntroDurationMs"`
	OutroDurationMs int       `json:"brandOutroDurationMs"`
	IsAccurate      bool      `json:"is_accurate"`
	DurationMs      int       `json:"runtime_length_ms"`
	DurationSec     int       `json:"runtime_length_sec"`
	Chapters        []Chapter `json:"chapters"`
}

type ContentRequest

type ContentRequest struct {
	*Request
}

func Content

func Content() *ContentRequest

func (*ContentRequest) Asin

func (c *ContentRequest) Asin(id string) (*ContentResponse, error)

func (*ContentRequest) Get

func (*ContentRequest) URL

type ContentResponse

type ContentResponse struct {
	Meta struct {
		ChapterInfo      `json:"chapter_info"`
		ContentReference struct {
			Asin string `json:"asin"`
		} `json:"content_reference"`
	} `json:"content_metadata"`
}

func (*ContentResponse) Chapters

func (c *ContentResponse) Chapters() []*avtools.Chapter

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 Product

type Product struct {
	Authors          []map[string]string `json:"authors"`
	ProductImages    map[string]string   `json:"product_images"`
	PublisherSummary string              `json:"publisher_summary"`
	RuntimeMin       int                 `json:"runtime_length_min"`
	Asin             string              `json:"asin"`
	Languages        string              `json:"language"`
	Narrators        []map[string]string `json:"narrators"`
	Publisher        string              `json:"publisher_name"`
	ReleaseDate      string              `json:"release_date"`
	Series           []map[string]string `json:"series"`
	Title            string              `json:"title"`
	ChapterInfo
}

func (Product) FilterValue

func (p Product) FilterValue() string

func (Product) ToBook

func (p Product) ToBook() cdb.Book

type ProductsRequest

type ProductsRequest struct {
	*Request
}

func Products

func Products() *ProductsRequest

func (*ProductsRequest) Get

func (p *ProductsRequest) Get() (*ProductsResponse, error)

func (*ProductsRequest) Search

func (p *ProductsRequest) Search(s *Search) (*ProductsResponse, error)

func (*ProductsRequest) URL

type ProductsResponse

type ProductsResponse struct {
	Products     []Product `json:"products"`
	TotalResults int       `json:"total_results"`
	Product      Product   `json:"product"`
}

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

type Request

type Request struct {
	Asin string

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

func (*Request) NumResults

func (r *Request) NumResults(n int) *Request

func (*Request) ParseURL

func (req *Request) ParseURL(uri string) (*Request, error)

func (*Request) String

func (req *Request) String() string

type Response

type Response struct {
	Products     []Product `json:"products"`
	TotalResults int       `json:"total_results"`
	Product      Product   `json:"product"`
}
type Search struct {
	// contains filtered or unexported fields
}

func NewSearch

func NewSearch(kw ...string) *Search

func (*Search) Author

func (s *Search) Author(kw ...string) *Search

func (*Search) Encode

func (s *Search) Encode() string

func (*Search) Narrator

func (s *Search) Narrator(kw ...string) *Search

func (*Search) String

func (s *Search) String() string

func (*Search) Title

func (s *Search) Title(kw ...string) *Search

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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