knadh / go-get-youtube

A tiny Go library + client for downloading Youtube videos. The library is capable of fetching Youtube video metadata, in addition to downloading videos.
158 stars 35 forks source link

youtube: option: add ability to make downloader silent #7

Closed streambinder closed 5 years ago

streambinder commented 6 years ago

I do not agree: if an error comes, then Download function should return that instance. But if that error is not really considered that way (you don't return it, you just print it), then you shouldn't be worried about muting it. I would anyway split Download and converting procedures into two separated functions, to overcome this obvious problem of handling errors. Errors about converting (and moving/renaming) files are fatals for an eventual Convert method, while it's not true, as matter of fact, for Download one, indeed.

dbatbold commented 6 years ago

If user wants to extract mp3 after downloading a video, and if command exits with no error output means the operation is completed successfully. Silent mode should only silence info messages, but not error messages. Also, ytdownload.go file needs to be updated to include --silent or -q switch that enables the option.Silent flag.