dlutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadSubtitleEntry

func DownloadSubtitleEntry(entry common.SubtitleListEntry) (retval common.DownloadedSubtitle, err error)

Types

type FetchInit

type FetchInit struct {
	Method       string
	Headers      []Header
	Body         []byte
	MaxRedirects int
}

func (FetchInit) AsFasthttpRequest

func (init FetchInit) AsFasthttpRequest() (req fasthttp.Request)
type Header struct {
	Key   string
	Value string
}

type ResponseStatus

type ResponseStatus int

func FetchHtml

func FetchHtml(url string, init FetchInit) (out *goquery.Document, status ResponseStatus, err error)

func FetchJson

func FetchJson[T any](url string, init FetchInit) (json T, status ResponseStatus, err error)

func FetchText

func FetchText(url string, init FetchInit) (body []byte, status ResponseStatus, err error)

func (ResponseStatus) Error

func (status ResponseStatus) Error() error

func (ResponseStatus) OK

func (status ResponseStatus) OK() bool

Jump to

Keyboard shortcuts

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