util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2020 License: GPL-3.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RetryTimes = 10

RetryTimes is the number of times that download

View Source
var UserToken = "" /* 205-byte string literal not displayed */

UserToken is the session shared among all devices. TODO(#3): replace this hard-coded one flesh token from logging in.

View Source
var VerboseMode = false

VerboseMode shows whether the program runs under verbose mode.

Functions

func ExtractM3u8BaseURL

func ExtractM3u8BaseURL(url string) (string, error)

ExtractM3u8BaseURL extracts the base URL for *.ts videos.

func ExtractTvidPartidFromURL

func ExtractTvidPartidFromURL(url string) (string, string, error)

ExtractTvidPartidFromURL extracts the IDs.

func FetchLinkContent

func FetchLinkContent(url string) ([]byte, error)

FetchLinkContent downloads the link content to variable in memory.

func FetchLinkContentWithRetry

func FetchLinkContentWithRetry(url string) ([]byte, error)

FetchLinkContentWithRetry downloads the link content to variable in memory with retry.

func SanitizeFileName

func SanitizeFileName(fn string) string

SanitizeFileName replaces illegal characters in the file.

func StructToURLValues

func StructToURLValues(i interface{}) (values url.Values)

StructToURLValues convert a struct to url.Values map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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