diff --git a/go.mod b/go.mod index 67c50516..b63da281 100644 --- a/go.mod +++ b/go.mod @@ -19,3 +19,5 @@ require ( golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f // indirect google.golang.org/appengine v1.6.6 // indirect ) + +replace github.com/zmb3/spotify => github.com/p1ass/spotify v0.0.0-20200804070451-35a3efb1eefb \ No newline at end of file diff --git a/go.sum b/go.sum index 44261a7e..16abb252 100644 --- a/go.sum +++ b/go.sum @@ -48,6 +48,8 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-sqlite3 v1.11.0 h1:LDdKkqtYlom37fkvqs8rMPFKAMe8+SgjbwZ6ex1/A/Q= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= +github.com/p1ass/spotify v0.0.0-20200804070451-35a3efb1eefb h1:1SzuWPo6QDjBEDEh4e13eVpP917MMl0uoQV0yEShGEg= +github.com/p1ass/spotify v0.0.0-20200804070451-35a3efb1eefb/go.mod h1:CYu0Uo+YYMlUX39zUTsCU9j3SpK3l1eB8oLykXF7R7w= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/poy/onpar v0.0.0-20190519213022-ee068f8ea4d1 h1:oL4IBbcqwhhNWh31bjOX8C/OCy0zs9906d/VUru+bqg= diff --git a/spotify/track.go b/spotify/track.go index 096f94cf..70505b95 100644 --- a/spotify/track.go +++ b/spotify/track.go @@ -20,6 +20,7 @@ func (c *Client) Search(ctx context.Context, q string) ([]*entity.Track, error) } cli := c.auth.NewClient(token) + cli.AcceptLanguage = "ja,en;q=0.9" result, err := cli.Search(q, spotify.SearchTypeTrack) if err != nil { return nil, fmt.Errorf("search q=%s: %w", q, err) @@ -37,6 +38,7 @@ func (c *Client) GetTracksFromURI(ctx context.Context, trackURIs []string) ([]*e return nil, fmt.Errorf("token not found") } cli := c.auth.NewClient(token) + cli.AcceptLanguage = "ja,en;q=0.9" ids := make([]spotify.ID, len(trackURIs)) for i, trackURI := range trackURIs {