diff --git a/server/spotify/downloader.go b/server/spotify/downloader.go index 1e32841..3838561 100644 --- a/server/spotify/downloader.go +++ b/server/spotify/downloader.go @@ -28,13 +28,12 @@ const DELETE_SONG_FILE = false var yellow = color.New(color.FgYellow) func DlSingleTrack(url, savePath string) (int, error) { + fmt.Println("Getting track info (" + url + ")...") trackInfo, err := TrackInfo(url) if err != nil { return 0, err } - fmt.Println("Getting track info...") - time.Sleep(500 * time.Millisecond) track := []Track{*trackInfo} fmt.Println("Now, downloading track...") @@ -198,6 +197,7 @@ func downloadYTaudio(id, path, filePath string) error { client := youtube.Client{} video, err := client.GetVideo(id) if err != nil { + fmt.Println("Error: ", err) return err } diff --git a/server/spotify/youtube.go b/server/spotify/youtube.go index b1d4e7a..51d5d04 100644 --- a/server/spotify/youtube.go +++ b/server/spotify/youtube.go @@ -96,6 +96,7 @@ func GetYoutubeId(track Track) (string, error) { allowedDurationRangeEnd := songDurationInSeconds + durationMatchThreshold resultSongDuration := convertStringDurationToSeconds(result.Duration) if resultSongDuration >= allowedDurationRangeStart && resultSongDuration <= allowedDurationRangeEnd { + fmt.Println("INFO: ", fmt.Sprintf("Found song with id '%s'", result.ID)) return result.ID, nil } }