Documentation
¶
Overview ¶
utility functions
Index ¶
- func ReencodeForTelegramIOS(path string) error
- type FileResult
- type Grabber
- func (g *Grabber) Download(mediaUrl string, name string) ([]FileResult, error)
- func (g *Grabber) IdentifyPlatform(webUrl string) Platform
- func (g *Grabber) WithBaseDir(baseDir string) *Grabber
- func (g *Grabber) WithFormat(format string) *Grabber
- func (g *Grabber) WithMaxFileSize(size string) *Grabber
- func (g *Grabber) WithNoPlaylist(noPlaylist bool) *Grabber
- func (g *Grabber) WithOptions(options *Options) *Grabber
- func (g *Grabber) WithOutputTemplate(template string) *Grabber
- func (g *Grabber) WithRecodeVideo(format string) *Grabber
- func (g *Grabber) WithRestrictFilenames(restrict bool) *Grabber
- func (g *Grabber) WithWriteThumbnail(write bool) *Grabber
- type MediaType
- type Options
- type Platform
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReencodeForTelegramIOS ¶
ReencodeForIOS takes input and output file paths and re-encodes the video to be iOS/Telegram-compatible.
Types ¶
type FileResult ¶
FileResult represents the result of a download operation
type Grabber ¶
type Grabber struct {
// contains filtered or unexported fields
}
Grabber handles media downloading functionality
func (*Grabber) Download ¶
func (g *Grabber) Download(mediaUrl string, name string) ([]FileResult, error)
Download downloads media from the provided URL using yt-dlp
func (*Grabber) IdentifyPlatform ¶
IdentifyPlatform checks the domain of the URL to determine the platform
func (*Grabber) WithBaseDir ¶
Only set base directory for the grabber
func (*Grabber) WithFormat ¶
WithFormat sets the format preference for yt-dlp
func (*Grabber) WithMaxFileSize ¶
WithMaxFileSize sets the maximum file size to download
func (*Grabber) WithNoPlaylist ¶
WithNoPlaylist sets whether to download only a single video/image if the URL is part of a playlist
func (*Grabber) WithOptions ¶
WithOptions creates a new Grabber instance with the provided options
func (*Grabber) WithOutputTemplate ¶
WithOutputTemplate sets the output filename template
func (*Grabber) WithRecodeVideo ¶
WithRecodeVideo sets the video recoding format
func (*Grabber) WithRestrictFilenames ¶
WithRestrictFilenames enables or disables filename sanitization
func (*Grabber) WithWriteThumbnail ¶
WithWriteThumbnail enables or disables thumbnail downloading
type Options ¶
type Options struct {
BaseDir string // BaseDir is the directory where downloaded files will be saved
MaxFileSize string // MaxFileSize is the maximum file size to download (e.g., "49M" for 49 megabytes)
Format string // Format specifies the format preference for yt-dlp
RestrictFilenames bool // RestrictFilenames sanitizes filenames if true
RecodeVideo string // RecodeVideo specifies the video format to recode to (e.g., "mp4")
NoPlaylist bool // NoPlaylist downloads only single video/image if URL is part of a playlist
WriteThumbnail bool // WriteThumbnail attempts to download thumbnail if true
OutputTemplate string // OutputTemplate specifies the output filename template
}
Options represents configuration options for the Grabber