utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2019 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyMap

func CopyMap(m map[string]string) map[string]string

CopyMap creates a copy of given map of string.

func DownloadVideo

func DownloadVideo(videoUrl string, videoId string, vFormat string, userFfmpegPath string, outputFileName string, metadataFlag bool)

DownloadVideo downloads the video for given video format and video url. It also adds metadata to it if needed. FFMPEG path and Output video file name can be customized.

func Generate

func Generate(start int64) string

Generate generates Hotstar authorization code for given time.

func GenerateHotstarAuth

func GenerateHotstarAuth() string

GenerateHotstarAuth generates Hotstar authorization code.

func GetDateStr

func GetDateStr(timeFloat64 float64) string

GetDateStr parses given time in milliseconds to human readable Date string.

func GetMasterPlaybackUrl

func GetMasterPlaybackUrl(playbackUriPageContents []byte) (string, error)

GetMasterPlaybackUrl gets master playback url from playback uri page contents.

func GetParsedVideoUrl

func GetParsedVideoUrl(videoUrl string) string

GetParsedVideoUrl parses given video url for proper url scheme.

func GetPlaybackUri

func GetPlaybackUri(videoUrlPageContents string, videoUrl string, videoId string) (string, map[string]string, error)

GetPlaybackUri gets the playback uri from the metadata in the given page contents.

func GetVideoFormats

func GetVideoFormats(videoUrl string, videoId string) (map[string]map[string]string, map[string]string, error)

GetVideoFormats gets all available video formats for given video url.

func IsValidHotstarUrl

func IsValidHotstarUrl(videoUrl string) (bool, string)

IsValidHotstarUrl validates if the given video url is a valid Hotstar url or not.

func ListVideoFormats

func ListVideoFormats(videoUrl string, videoId string, titleFlag bool, descriptionFlag bool)

ListVideoFormats lists video formats (or) title (or) description of the video for given video url.

func MakeGetRequest

func MakeGetRequest(url string, headers map[string]string) ([]byte, error)

MakeGetRequest makes GET request for given url with given headers and returns web page contents as bytes with errors if any.

func ParseM3u8Content

func ParseM3u8Content(m3u8Content string, playbackUrl string, playbackUrlData string) map[string]map[string]string

ParseM3u8Content parses given m3u8Content content and returns map of map of string containing video format list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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