Documentation ¶
Index ¶
- Constants
- 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 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 GetPlaybackURI2(videoID string, uuid string) string
- func GetPlaybackURI3(videoID string, uuid string) string
- func GetVideoFormats(videoURL string, videoID string, meta map[string]string) (map[string]map[string]string, map[string]string, error)
- func IsValidHotstarURL(videoOrPlaylistURL string) (bool, string, bool)
- func ListOrDownloadPlaylistVideoFormats(playlistID string, titleFlag bool, descriptionFlag bool, ...)
- func ListVideoFormats(videoURL string, videoID string, metadata map[string]string, titleFlag 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
- func PopulateMetaDataMapWithMetadata(metaDataMap map[string]string, metadata map[string]interface{})
- func ReSubMatchMap(r *regexp.Regexp, str string) map[string]string
- type AdaptationSet
- type AudioChannelConfiguration
- type MPD
- type Representation
- type SegmentTemplate
Constants ¶
const ACTOR = "actor"
ACTOR a metadata constant for actor entry
const CONTENTID = "contentId"
CONTENTID a metadata constant for content id entry
const GENRE = "genre"
GENRE a metadata constant for genre entry
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, requestHeaders 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 GetPlaybackURI2 ¶
GetPlaybackURI2 gets the playback uri v2 from videoID
func GetPlaybackURI3 ¶
GetPlaybackURI3 gets the playback uri v2 from videoID
func GetVideoFormats ¶
func GetVideoFormats(videoURL string, videoID string, meta map[string]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 ListOrDownloadPlaylistVideoFormats ¶
func ListOrDownloadPlaylistVideoFormats(playlistID string, titleFlag bool, descriptionFlag bool, playlistStartRange string, playlistEndRange string, isDownloadSwitch bool, vFormat string, userFfmpegPath string, outputFileName string, metadataFlag bool, isDashAV bool)
ListOrDownloadPlaylistVideoFormats lists video formats (or) title (or) description of each video url in the list.
func ListVideoFormats ¶
func ListVideoFormats(videoURL string, videoID string, metadata map[string]string, titleFlag bool, descriptionFlag bool)
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.
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.
func PopulateMetaDataMapWithMetadata ¶
func PopulateMetaDataMapWithMetadata(metaDataMap map[string]string, metadata map[string]interface{})
PopulateMetaDataMapWithMetadata poulates metadata map with required meta-data
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