ruvido / goSpotifyPodcastAnalytics

MIT License
0 stars 0 forks source link

Where do SP_DC and SP_KEY come from? #1

Closed jerodsanto closed 1 month ago

jerodsanto commented 1 month ago

Howdy! 👋

I'm reading along, trying to figure out how this all fits together and I'm curious what all goes in .env to get it working. Specifically this bit:

spDc := viper.GetString("SP_DC")
spKey := viper.GetString("SP_KEY")

I see you are setting these as your cookie when getting an authorization code. Do you have to fetch those out of your browser from a cookie Spotify sets after signing in? If so, how long are they valid?

ruvido commented 1 month ago

Hi Jerod,

You're right—those variables are pulled from browser cookies, and they happen to be session cookies. This means they don’t have a set expiration date and are cleared when the browser is closed.

The code is still in a rough state, but I’m aiming to have something more polished by mid-September. Since I self-host my podcasts and most of the data comes from Caddy logs on my server, as well as Spotify and Apple, I needed a unified view of the analytics. That’s why I’m developing an independent, open-source, terminal-based podcast analytics tool. The closest tool I’ve found that fills this gap is https://github.com/openpodcast

Best

On Wed, Sep 4, 2024 at 5:28 PM Jerod Santo @.***> wrote:

Howdy! 👋

I'm reading along, trying to figure out how this all fits together and I'm curious what all goes in .env to get it working. Specifically this bit:

spDc := viper.GetString("SP_DC")spKey := viper.GetString("SP_KEY")

I see you are setting these as your cookie when getting an authorization code. Do you have to fetch those out of your browser from a cookie Spotify sets after signing in? If so, how long are they valid?

— Reply to this email directly, view it on GitHub https://github.com/ruvido/goSpotifyPodcastAnalytics/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFOR3BUPF7VY6BJFRM3N6DZU4RJ5AVCNFSM6AAAAABNUSVGUGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGUYDKNRZGI2TAMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

jerodsanto commented 1 month ago

Very cool, looks like that openpodcast project has a similar tool in Python.

We're (changelog.com) very interested in getting our listener data out of Spotify.

That’s why I’m developing an independent, open-source, terminal-based podcast analytics tool.

Let me know when you have something public!