Documentation ¶
Index ¶
- func CopyMap(m map[string]string) map[string]string
- func DownloadAudioOrVideo(videoURL string, videoID string, vFormat string, userFfmpegPath string, ...)
- func DownloadDashFilesBatch(currentDirectoryPath, videoID string, vFormatCode string, ...) ([]string, string)
- func Generate(start int64) string
- func GenerateHotstarAuth() string
- func GetBestOrLeastResolutionFormat(videoFormats map[string]map[string]string, bestOrLeast string) string
- func GetDashFormats(data []byte, masterPlaybackURL string) map[string]map[string]map[string]string
- func GetDateStr(timeFloat64 float64) string
- func GetMasterPlaybackURLs(playbackURIPageContents []byte) ([]string, error)
- func GetParsedVideoURL(videoURL string) string
- func GetPlaybackURI(videoURLPageContents string, videoURL string, videoID string, uuid string) (string, map[string]string, error)
- func GetVideoFormats(videoURL string, videoID string) (map[string]map[string]string, map[string]string, error)
- func IsValidHotstarURL(videoURL string) (bool, string)
- func ListVideoFormats(videoURL string, videoID string, titleFlag bool, descriptionFlag bool)
- func MakeGetRequest(url string, headers map[string]string) ([]byte, error)
- func MakeRange(min, max int) []int
- func ParseM3u8Content(m3u8Content string, playbackURL string, playbackURLData string) map[string]map[string]string
- type AdaptationSet
- type AudioChannelConfiguration
- type MPD
- type Representation
- type SegmentTemplate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAudioOrVideo ¶
func DownloadAudioOrVideo(videoURL string, videoID string, vFormat string, userFfmpegPath string, outputFileName string, metadataFlag bool, isDashAV bool)
DownloadAudioOrVideo 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 DownloadDashFilesBatch ¶
func DownloadDashFilesBatch(currentDirectoryPath, videoID string, vFormatCode string, format map[string]string) ([]string, string)
DownloadDashFilesBatch downloads the dash chunks for the given video format
func GenerateHotstarAuth ¶
func GenerateHotstarAuth() string
GenerateHotstarAuth generates Hotstar authorization code.
func GetDashFormats ¶
GetDashFormats gives the dash formats for any given dash URL
func GetDateStr ¶
GetDateStr parses given time in milliseconds to human readable Date string.
func GetMasterPlaybackURLs ¶
GetMasterPlaybackURLs gets master playback urls from playback uri page contents.
func GetParsedVideoURL ¶
GetParsedVideoURL parses given video url for proper url scheme.
func GetPlaybackURI ¶
func GetPlaybackURI(videoURLPageContents string, videoURL string, videoID string, uuid 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 ¶
IsValidHotstarURL validates if the given video url is a valid Hotstar url or not.
func ListVideoFormats ¶
ListVideoFormats lists video formats (or) title (or) description of the video for given video url.
func MakeGetRequest ¶
MakeGetRequest makes GET request for given url with given headers and returns web page contents as bytes with errors if any.
Types ¶
type AdaptationSet ¶
type AdaptationSet struct { MaxHeight string `xml:"maxHeight,attr"` MaxWidth string `xml:"maxWidth,attr"` MimeType string `xml:"mimeType,attr"` SegmentAlignment string `xml:"segmentAlignment,attr"` StartWithSAP string `xml:"startWithSAP,attr"` SegTemplate SegmentTemplate `xml:"SegmentTemplate"` Representations []Representation `xml:"Representation"` }
AdaptationSet struct contains
type AudioChannelConfiguration ¶
type AudioChannelConfiguration struct { SchemeIDURI string `xml:"schemeIdUri,attr"` Value string `xml:"value,attr"` }
AudioChannelConfiguration struct contains config of channel
type MPD ¶
type MPD struct { MediaPresentationDuration string `xml:"mediaPresentationDuration,attr"` MinBufferTime string `xml:"minBufferTime,attr"` Profiles string `xml:"profiles,attr"` Xmlns string `xml:"xmlns,attr"` Period []AdaptationSet `xml:"Period>AdaptationSet"` }
MPD struct contains
type Representation ¶
type Representation struct { Bandwidth string `xml:"bandwidth,attr"` Codecs string `xml:"codecs,attr"` FrameRate string `xml:"frameRate,attr"` Height string `xml:"height,attr"` ID string `xml:"id,attr"` ScanType string `xml:"scanType,attr"` Width string `xml:"width,attr"` AudioSamplingRate string `xml:"audioSamplingRate,attr"` AudioChannelConfiguration string `xml:"AudioChannelConfiguration"` }
Representation struct contains
type SegmentTemplate ¶
type SegmentTemplate struct { Duration string `xml:"duration,attr"` Initialization string `xml:"initialization,attr"` Media string `xml:"media,attr"` StartNumber string `xml:"startNumber,attr"` Timescale string `xml:"timescale,attr"` }
SegmentTemplate struct contains info about segments