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

Commit

Permalink
Try to reauth spotify on each call
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiskey committed Mar 27, 2022
1 parent 5108533 commit cb4f0d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Make sure you have **golang**, **youtube-dl** and **ffmpeg** installed.
### Environment variables to pass:
```bash
DEBUG=false
ROLLBAR_TOKEN=4a505f108ef0402b9b2db8f363793946
ROLLBAR_TOKEN=xxxxxxxxxxxxxxxxxxxx111111
TELEGRAM_APITOKEN=11111111111:XXXXXXXXXXXxxxxxxxxxx
SPOTIFY_ID=05c5bdfd503c4a489961d2e63f917b1d
SPOTIFY_ID=xxxxxxxxxxxxxxxxxxxx111111
SPOTIFY_SECRET=xxxxxxxxxxxxxxxxxxxx111111
```
8 changes: 5 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ var commandsKeyboard = tgbotapi.NewReplyKeyboard(

func init() {
rollbar.SetToken(os.Getenv("ROLLBAR_TOKEN"))
rollbar.SetEnvironment("production") // defaults to "development"
//rollbar.SetCodeVersion("v2") // optional Git hash/branch/tag (required for GitHub integration)
//rollbar.SetServerHost("web.1") // optional override; defaults to hostname
rollbar.SetEnvironment("production")
rollbar.SetCodeVersion("v1.1.3") // optional Git hash/branch/tag (required for GitHub integration)
//rollbar.SetServerHost("release.1") // optional override; defaults to hostname
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 "/"

if os.Getenv("DEBUG") == "true" {
Expand Down Expand Up @@ -76,6 +76,8 @@ func init() {
}

func ProcessUrl(i int, playlistURL string, update tgbotapi.Update, msg tgbotapi.MessageConfig) {
spotifyClient = auths.AuthSpotifyWithCreds()
apiEntity.SpotifyClient = spotifyClient
savedFile, err := spotifydl.DonwloadFromURL(ctx, playlistURL, apiEntity)
if err != nil {
log.Print(err)
Expand Down

0 comments on commit cb4f0d6

Please sign in to comment.