videodownload

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.0.10

type Config struct {
	LibraryDir          string
	LibraryOwner        string
	VideoSourcesService *videosources.Service
	VideoStore          VideoStore
	VideoDownloadHooks  VideoDownloadHooks
	FeedStore           FeedStore
	FeedItemStore       FeedItemStore
	JobsManager         *jobsmanager.JobsManager
}

type DownloadProvider added in v0.0.10

type DownloadProvider interface {
	GetVideoMetadata(ctx context.Context, videoRef models.VideoRef) (*models.Video, error)
	DownloadVideo(ctx context.Context, videoRef models.VideoRef, options models.DownloadOptions, logline func(logMessage models.LogMessage)) (outputFilename string, err error)
}

type FeedItemStore added in v0.0.10

type FeedItemStore interface {
	GetByVideoRef(ctx context.Context, videoRef models.VideoRef) (*models.FeedItem, error)
}

type FeedStore added in v0.0.10

type FeedStore interface {
	Get(ctx context.Context, id uuid.UUID) (models.Feed, error)
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(config Config) *Service

func (*Service) GetVideoMetadata added in v0.0.10

func (s *Service) GetVideoMetadata(ctx context.Context, videoRef models.VideoRef) (*models.Video, error)

func (*Service) QueueForDownload

func (s *Service) QueueForDownload(ctx context.Context, videoRef models.VideoRef, feed *models.Feed) error

TODO: remove use of feedID

type VideoDownloadHooks added in v0.0.10

type VideoDownloadHooks interface {
	NewVideoDownloaded(ctx context.Context, outVideoFile string) error
}

type VideoStore added in v0.0.10

type VideoStore interface {
	Save(video models.SavedVideo) error
	DeleteWithExtID(extId models.VideoRef) error
}

type YoutubeDownloadTask added in v0.0.10

type YoutubeDownloadTask struct {
	VideoRef    models.VideoRef
	LibraryDir  string
	TargetDir   string
	TargetOwner string

	VideoSource       DownloadProvider
	VideoStore        VideoStore
	VideoDownloadHook VideoDownloadHooks
	Feed              *models.Feed
	// contains filtered or unexported fields
}

func (*YoutubeDownloadTask) Execute added in v0.0.10

func (y *YoutubeDownloadTask) Execute(ctx context.Context, runContext jobs.RunContext) error

func (*YoutubeDownloadTask) Init added in v0.0.10

func (y *YoutubeDownloadTask) Init()

func (*YoutubeDownloadTask) String added in v0.0.10

func (y *YoutubeDownloadTask) String() string

func (*YoutubeDownloadTask) VideoExtID added in v0.0.10

func (y *YoutubeDownloadTask) VideoExtID() string

func (*YoutubeDownloadTask) VideoTitle added in v0.0.10

func (y *YoutubeDownloadTask) VideoTitle() string

Jump to

Keyboard shortcuts

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