removed backup

This commit is contained in:
Felipe M 2025-05-07 10:21:54 +02:00
parent 2c7a5dff6c
commit 83843de4ee
Signed by: fmartingr
GPG key ID: CCFBC5637D4000A8

20
main.go
View file

@ -18,12 +18,11 @@ import (
)
var (
token string
radioURL = "https://atres-live.europafm.com/live/europafm/bitrate_1.m3u8"
backupRadioURL = "https://playerservices.streamtheworld.com/api/livestream-redirect/EUROPA_FM.mp3"
logger *slog.Logger
debug bool
guildID string // For testing in a specific guild
token string
radioURL = "https://atres-live.europafm.com/live/europafm/bitrate_1.m3u8"
logger *slog.Logger
debug bool
guildID string // For testing in a specific guild
)
func init() {
@ -479,14 +478,5 @@ func playAudioStream(vc *discordgo.VoiceConnection, url string, stopChan chan bo
// If we get here, the stream ended unexpectedly
logger.Warn("Audio stream ended unexpectedly")
// If primary URL fails and it's not the backup URL, try the backup URL
if url == radioURL && backupRadioURL != "" {
logger.Info("Primary URL failed, trying backup URL", "backup_url", backupRadioURL)
dgvoice.PlayAudioFile(vc, backupRadioURL, stopChan)
// If we get here, the backup stream also ended unexpectedly
logger.Warn("Backup audio stream also ended unexpectedly")
}
return fmt.Errorf("audio stream ended unexpectedly")
}