Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit cb4f0d6

Browse files
committed
Try to reauth spotify on each call
1 parent 5108533 commit cb4f0d6

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

README.MD

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Make sure you have **golang**, **youtube-dl** and **ffmpeg** installed.
3232
### Environment variables to pass:
3333
```bash
3434
DEBUG=false
35-
ROLLBAR_TOKEN=4a505f108ef0402b9b2db8f363793946
35+
ROLLBAR_TOKEN=xxxxxxxxxxxxxxxxxxxx111111
3636
TELEGRAM_APITOKEN=11111111111:XXXXXXXXXXXxxxxxxxxxx
37-
SPOTIFY_ID=05c5bdfd503c4a489961d2e63f917b1d
37+
SPOTIFY_ID=xxxxxxxxxxxxxxxxxxxx111111
3838
SPOTIFY_SECRET=xxxxxxxxxxxxxxxxxxxx111111
3939
```

main.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ var commandsKeyboard = tgbotapi.NewReplyKeyboard(
3535

3636
func init() {
3737
rollbar.SetToken(os.Getenv("ROLLBAR_TOKEN"))
38-
rollbar.SetEnvironment("production") // defaults to "development"
39-
//rollbar.SetCodeVersion("v2") // optional Git hash/branch/tag (required for GitHub integration)
40-
//rollbar.SetServerHost("web.1") // optional override; defaults to hostname
38+
rollbar.SetEnvironment("production")
39+
rollbar.SetCodeVersion("v1.1.3") // optional Git hash/branch/tag (required for GitHub integration)
40+
//rollbar.SetServerHost("release.1") // optional override; defaults to hostname
4141
rollbar.SetServerRoot("github.com/rhiskey/spotytg") // path of project (required for GitHub integration and non-project stacktrace collapsing) - where repo is set up for the project, the server.root has to be "/"
4242

4343
if os.Getenv("DEBUG") == "true" {
@@ -76,6 +76,8 @@ func init() {
7676
}
7777

7878
func ProcessUrl(i int, playlistURL string, update tgbotapi.Update, msg tgbotapi.MessageConfig) {
79+
spotifyClient = auths.AuthSpotifyWithCreds()
80+
apiEntity.SpotifyClient = spotifyClient
7981
savedFile, err := spotifydl.DonwloadFromURL(ctx, playlistURL, apiEntity)
8082
if err != nil {
8183
log.Print(err)

0 commit comments

Comments
 (0)