Skip to content

Commit

Permalink
Update spotyzam.go
Browse files Browse the repository at this point in the history
  • Loading branch information
cascooscuro authored Feb 13, 2022
1 parent d70a0c9 commit b856b43
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions spotyzam.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,22 +88,19 @@ func main() {
fmt.Println("You are logged in as:", user.ID)


PlaylistId := os.Args[1]
Filename := os.Args[2]



PlaylistId := os.Args[1]
Filename := os.Args[2]

f, err := os.Open(Filename)
if err != nil {
panic(err)
}
defer f.Close()
records, err := readSample(f)
if err != nil {
panic(err)
}

f, err := os.Open(Filename)
if err != nil {
panic(err)
}
defer f.Close()
records, err := readSample(f)
if err != nil {
panic(err)
}



results, err := client.GetPlaylist(context.Background(), spotify.ID(PlaylistId))
Expand Down Expand Up @@ -266,7 +263,7 @@ func completeAuth(w http.ResponseWriter, r *http.Request) {
}

// use the token to get an authenticated client
client := spotify.New(auth.Client(r.Context(), tok))
client := spotify.New(auth.Client(r.Context(), tok),spotify.WithRetry(true))
fmt.Fprintf(w, "Login Completed!")
ch <- client
}
Expand All @@ -284,6 +281,7 @@ func readSample(rs io.ReadSeeker) ([][]string, error) {

// Read remaining rows
r := csv.NewReader(rs)
r.LazyQuotes = true
rows, err := r.ReadAll()
if err != nil {
return nil, err
Expand Down

0 comments on commit b856b43

Please sign in to comment.