Skip to content

Commit

Permalink
plugins: (spotifytoyoutube) Fix issue caused by recent Spotify change
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT2 committed Jun 21, 2022
1 parent eb83166 commit c581ff2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/spotifytoyoutube/spotifytoyoutube.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/5HT2/taro-bot/cmd"
"github.com/5HT2/taro-bot/plugins"
"github.com/5HT2/taro-bot/util"
"golang.org/x/net/html"
"log"
"net/http"
"net/url"
Expand Down Expand Up @@ -57,7 +58,7 @@ func SpotifyToYoutubeResponse(r bot.Response) {
return
}

node, err := util.ExtractNode(string(content), func(str string) bool { return str == "title" })
node, err := util.ExtractNode(string(content), func(node *html.Node) bool { return node.Data == "title" && node.FirstChild.Data != "Spotify" })
if err != nil {
_, _ = cmd.SendEmbed(r.E, "", "Error: "+err.Error(), bot.ErrorColor)
return
Expand Down

0 comments on commit c581ff2

Please sign in to comment.