mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 20:18:07 +01:00
feat: add download fallback
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var ErrTidalUrlNotFound = errors.New("Tidal URL not found.")
|
||||
|
||||
func (app *App) LoadTidalApis() error {
|
||||
var found bool
|
||||
|
||||
@@ -119,11 +121,15 @@ func (app *App) ParseTidalManifestFromBase64(manifestBase64 string) (TidalManife
|
||||
err = json.Unmarshal(manifestDecoded, &result)
|
||||
if err != nil {
|
||||
return result, err
|
||||
}
|
||||
}
|
||||
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func (app *App) GetTidalIdFromSonglink(songlink SongLinkResponse) (string, error) {
|
||||
if songlink.LinksByPlatform.Tidal == nil {
|
||||
return "", ErrTidalUrlNotFound
|
||||
}
|
||||
|
||||
return ParseTrackId(songlink.LinksByPlatform.Tidal.Url)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user