mirror of
https://github.com/Superredstone/spotiflac-cli.git
synced 2026-03-07 12:11:47 +01:00
26 lines
372 B
Go
26 lines
372 B
Go
package pkg
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type UrlType int
|
|
|
|
const (
|
|
UrlTypeTrack UrlType = iota
|
|
UrlTypePlaylist
|
|
UrlTypeInvalid
|
|
)
|
|
|
|
func GetUrlType(url string) UrlType {
|
|
if strings.Contains(url, "https://open.spotify.com/track") {
|
|
return UrlTypeTrack
|
|
}
|
|
|
|
if strings.Contains(url, "https://open.spotify.com/playlist") {
|
|
return UrlTypePlaylist
|
|
}
|
|
|
|
return UrlTypeInvalid
|
|
}
|