diff --git a/internal/yandex/client.go b/internal/yandex/client.go index ad375d8..5439190 100644 --- a/internal/yandex/client.go +++ b/internal/yandex/client.go @@ -221,6 +221,12 @@ func (c *YandexClient) GetTrackDownloadURL(ctx context.Context, trackID string) return "", fmt.Errorf("no suitable download info found") } + if c.debug { + for i, info := range downloadInfos { + c.logger.Debug("download info candidate", "index", i, "codec", info.Codec, "bitrate", info.Bitrate, "direct_link", info.DirectLink, "url", info.URL) + } + } + // If we have a direct URL, use it if bestInfo.URL != "" && bestInfo.DirectLink { return bestInfo.URL, nil @@ -253,5 +259,5 @@ func (c *YandexClient) GetTrackDownloadURL(ctx context.Context, trackID string) return finalURL, nil } - return "", fmt.Errorf("no download URL available") + return "", fmt.Errorf("no download URL available: bestInfo.URL is empty (codec=%s, bitrate=%d, direct_link=%v)", bestInfo.Codec, bestInfo.Bitrate, bestInfo.DirectLink) }