mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-08 04:28:07 +01:00
fix: add edge case to id parsing in url
This commit is contained in:
@@ -31,5 +31,10 @@ func ParseTrackId(url string) (string, error) {
|
||||
return "", errors.New("Invalid URL.")
|
||||
}
|
||||
|
||||
return tmp[len(tmp)-1], nil
|
||||
tmp2 := strings.Split(tmp[len(tmp)-1], "?")
|
||||
if len(tmp2) == 0 {
|
||||
return tmp[len(tmp)-1], nil
|
||||
}
|
||||
|
||||
return tmp2[0], nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user