utils

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation(question string) (bool, error)

func CatchInterrupt

func CatchInterrupt(tmpPath *string)

func CheckIfInArray

func CheckIfInArray(arr []string, val string) bool

func CheckIfMultipleInArray

func CheckIfMultipleInArray(arr []string, val string) bool

func CheckIfPathExists

func CheckIfPathExists(path string) bool

func CleanUp

func CleanUp(path string) error

func Decrypt

func Decrypt(encrypted []byte, key []byte, iv []byte) ([]byte, error)

func MakeDirectoryIfNotExists

func MakeDirectoryIfNotExists(path string) error

func MergeToMP4

func MergeToMP4(listPath string, outputPath string) ([]byte, error)

func NewHttpClient

func NewHttpClient(proxyUrl string) (*http.Client, error)

func Request

func Request(method string, client *http.Client, url string, headers map[string]string, body io.Reader) (io.ReadCloser, error)

Types

type Bar

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

func NewProgressBar

func NewProgressBar(start int64, total int64, graph string) *Bar

func (*Bar) Add

func (bar *Bar) Add(value int64)

func (*Bar) Finish

func (bar *Bar) Finish()

type Downloader

type Downloader struct {
	Client *http.Client
}

func NewDownloader

func NewDownloader(client *http.Client) *Downloader

func (*Downloader) Download

func (downloader *Downloader) Download(m3u8Url string, tmpPath string, outputPath string) error

type HentaiVideo

type HentaiVideo struct {
	Name           string `json:"name"`
	Slug           string `json:"slug"`
	Description    string `json:"description"`
	Views          int64  `json:"views"`
	Interests      int64  `json:"interests"`
	Brand          string `json:"brand"`
	Likes          int64  `json:"likes"`
	Dislikes       int64  `json:"dislikes"`
	Downloads      int64  `json:"downloads"`
	MonthlyRank    int64  `json:"monthly_rank"`
	CreatedAtUnix  int64  `json:"created_at_unix"`
	ReleasedAtUnix int64  `json:"released_at_unix"`
}

type HttpError

type HttpError struct {
	Status string
}

func (*HttpError) Error

func (e *HttpError) Error() string

type Server

type Server struct {
	Streams []Stream `json:"streams"`
}

type Stream

type Stream struct {
	ID     int64  `json:"id"`
	Height string `json:"height"`
	Size   int64  `json:"filesize_mbs"`
	Url    string `json:"url"`
}

type Video

type Video struct {
	HentaiVideo    HentaiVideo    `json:"hentai_video"`
	VideosManifest VideosManifest `json:"videos_manifest"`
	StreamIndex    int
	OutputPath     string
}

type VideosManifest

type VideosManifest struct {
	Servers []Server `json:"servers"`
}

Jump to

Keyboard shortcuts

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