feat(cli): add output flag

This commit is contained in:
Mathis Maquenne
2024-10-14 16:22:44 +02:00
parent b49334a810
commit d2a9d93577
2 changed files with 17 additions and 4 deletions
+2 -2
View File
@@ -36,7 +36,7 @@ type Source struct {
const ChunkSize = 2048
func (m *Media) Download(filename, songID string) error {
func (m *Media) Download(path, songID string) error {
url := m.Data[0].Media[0].Sources[0].URL
resp, err := http.Get(url)
@@ -49,7 +49,7 @@ func (m *Media) Download(filename, songID string) error {
return fmt.Errorf("unexpected status code: %d", resp.StatusCode)
}
file, err := os.Create(filename)
file, err := os.Create(path)
if err != nil {
return err
}