Documentation ¶
Index ¶
- Constants
- func IsErrorAlreadyExists(err error) bool
- type DataSaver
- type Entry
- type FilenameTemplater
- type SaveVideo
- func (s *SaveVideo) DataHandler(ctx context.Context, d *ytfeed.Data)
- func (s *SaveVideo) DownloadVideo(ctx context.Context, videoName, url, quality, ext string, isLive bool, ...) (err error)
- func (s *SaveVideo) DownloadVideoWithRetries(ctx context.Context, retryDelay time.Duration, maxRetries int, ...) (err error)
- func (s *SaveVideo) SetRetries(retryDelay time.Duration, maxRetries int)
- func (s *SaveVideo) SetStreamScheduler(sc StreamScheduler)
- type StreamScheduler
- type YoutubeVideoLister
Constants ¶
View Source
const ( LiveBroadcastContentLive = "live" LiveBroadcastContentCompleted = "completed" LiveBroadcastContentNone = "none" LiveBroadcastContentUpcoming = "upcoming" DefaultTemplateName = "ytfeed-savestream-filename" DownloadingVideoStatus = true DefaultTemporaryDownloadDirectoryPermission = 0755 ErrFileAlreadyExistsFormat = "file %s already exists" )
View Source
const ( ErrInvalidVideoQuality = "invalid video quality: %s" ErrInvalidVideoExtension = "invalid video extension: %s" // for regular video // youtube-dl -f "bestvideo[ext=%s][height=%s]+bestaudio[ext=%s]" --merge-output-format ext -o temporaryfiledir/randomname url // for live download // youtube-dl -f "[height=%s]" -o temporaryfiledir/randomname https://www.youtube.com/watch?v=yF2va6QbnOs YoutubeDLCommand = "youtube-dl" FormatArg = "-f" FormatArgValueFormat = "bestvideo[ext=%s][height=%s]+bestaudio[ext=%s]" FormatArgValueLiveFormat = "[height=%s]" MergeOutputFormatArg = "--merge-output-format" OutputArg = "-o" AudioM4A = "m4a" AudioWebm = "webm" AudioMP4 = "mp4" ExtensionMP4 = "mp4" ExtensionWebm = "webm" ExtensionMKV = "mkv" Quality1080 = "1080" Quality720 = "720" Quality640 = "640" Quality480 = "480" Quality360 = "360" Quality240 = "240" Quality144 = "144" )
Variables ¶
This section is empty.
Functions ¶
func IsErrorAlreadyExists ¶
Types ¶
type Entry ¶
type Entry struct { Author string LinkURL string Title string VideoID string ChannelID string Published string PublishedYear int PublishedMonth string PublishedDay int PublishedHour int PublishedMinute int PublishedSecond int PublishedNanosecond int PublishedTimeZone string PublishedTimeZoneOffsetSeconds int VideoExtension string VideoQuality string }
type FilenameTemplater ¶
type SaveVideo ¶
type SaveVideo struct {
// contains filtered or unexported fields
}
func (*SaveVideo) DataHandler ¶
func (*SaveVideo) DownloadVideo ¶
func (*SaveVideo) DownloadVideoWithRetries ¶
func (*SaveVideo) SetRetries ¶
SetRetry because retries is optional, it doesn't have to be present at constructor function
func (*SaveVideo) SetStreamScheduler ¶
func (s *SaveVideo) SetStreamScheduler(sc StreamScheduler)
SetStreamScheduler because stream scheduler is optional, it doesn't have to be present at constructor function
type StreamScheduler ¶
type YoutubeVideoLister ¶
type YoutubeVideoLister interface {
List(part []string) *youtube.VideosListCall
}
Click to show internal directories.
Click to hide internal directories.