Documentation ¶
Overview ¶
Package feed provided parser and downloader for youtube feeds and entries.
Index ¶
Constants ¶
const ( FTDefault = Type("") FTChannel = Type("channel") FTPlaylist = Type("playlist") )
enum for the different YouTube feed types.
Variables ¶
var ErrSkip = errors.New("skip")
ErrSkip is returned when the file is not downloaded
Functions ¶
This section is empty.
Types ¶
type Downloader ¶
type Downloader struct {
// contains filtered or unexported fields
}
Downloader executes an external command to download a video and extract its audio.
func NewDownloader ¶
func NewDownloader(tmpl string, logOutWriter, logErrWriter io.Writer, destination string) *Downloader
NewDownloader creates a new Downloader with the given template (full command with placeholders for {{.ID}} and {{.Filename}}. Destination is the directory where the audio files will be stored.
func (*Downloader) Get ¶
Get downloads a video from youtube and extracts audio. yt-dlp --extract-audio --audio-format=mp3 --audio-quality=0 -f m4a/bestaudio "https://www.youtube.com/watch?v={{.ID}}" --no-progress -o {{.Filename}}
type Entry ¶
type Entry struct { ChannelID string `xml:"http://www.youtube.com/xml/schemas/2015 channelId"` VideoID string `xml:"http://www.youtube.com/xml/schemas/2015 videoId"` Title string `xml:"title"` Link struct { Href string `xml:"href,attr"` } `xml:"link"` Published time.Time `xml:"published"` Updated time.Time `xml:"updated"` Media struct { Description template.HTML `xml:"description"` Thumbnail struct { URL string `xml:"url,attr"` } `xml:"thumbnail"` } `xml:"http://search.yahoo.com/mrss/ group"` Author struct { Name string `xml:"name"` URI string `xml:"uri"` } `xml:"author"` File string Duration int // seconds DurationFmt string // used for ui only }
Entry represents a YouTube channel entry.