Skip to content

Adding Spotify and podcasts

AutoMiner can mine the podcast episodes you listen to on Spotify. It notices the listen, downloads the same episode from the show’s public RSS feed, has it transcribed, and mines the transcript like any other source. Songs you play on Spotify are recorded as listening time but never mined.

A few terms used on this page:

  • Source: one episode (or video) you listened to, with its lines and cards.
  • Platform: where sources come from. Spotify is one of the built-in platforms, next to YouTube, Stremio and Jellyfin. You install only the platforms you use.
  • Tracker: the part of a platform that notices what you play and reports it to AutoMiner. Spotify’s tracker runs inside AutoMiner and reads your Spotify account.
  • Feed: a podcast’s RSS feed, the public list of a show’s episodes with a link to each audio file. AutoMiner gets the audio from there, not from Spotify.
  • Transcription: speech-to-text. Podcasts have no subtitles, so a paid transcription service writes the lines that get mined.
Spotify web player Spotify app on your phone
Where you listen open.spotify.com in Chrome the Spotify app on your phone, or any Spotify app or speaker other than the web player
What reports it the AutoMiner Chrome extension the Spotify tracker inside AutoMiner
What you set up the extension, with your server’s URL in its popup a Spotify developer app, its keys stored on the server, and one authorization
How quickly it sees a play every 5 seconds at the next read of your playback state: up to 6 minutes after you press play, then every minute while it plays (defaults)

You can use either or both. A web listen and a phone listen of the same episode land on the same source.

Need For Notes
The Spotify platform installed everything on this page Step 1 below
A transcription provider with an API key every podcast OpenAI (Whisper) or ElevenLabs (Scribe), step 3
The Chrome extension, connected to your server web player listens see The Chrome extension
A Spotify developer app and shell access to the server phone listens step 5. There is no place in the web UI for the Spotify keys, so you need the autominer command. The Windows installer doesn’t put it on your PATH; run it through the bundled Python (see Command line)
A public RSS feed for the show fetching the audio most shows have one; Spotify-only shows don’t (see Shows with no feed)
  1. Open Settings › Sources.
  2. In the Platforms card, press Add. The Add a platform dialog opens.
  3. Press the + button on the Spotify row (its tooltip is Install).

A Spotify section now appears under Platforms, with two cards: Account and Podcast RSS.

Until Spotify is installed, AutoMiner accepts Spotify listens from the extension and then drops them, and the tracker doesn’t run. To remove the platform later, open Add again and press the trash button on the Spotify row (Uninstall Spotify), then confirm. That stops recording listens and fetching, and deletes the downloaded episode audio. Your settings, sources, clips and cards stay.

2. Choose how much of each episode to mine

Section titled “2. Choose how much of each episode to mine”

The Spotify section’s heading has a select with three choices:

Choice What happens to a podcast
All of it (default) A listen of any length gets the whole episode transcribed and mined.
Only what I watched The episode is transcribed only up to where you listened plus 2 minutes, and only the lines you heard become candidates. Listening further later transcribes and mines the next part. When that point (where you listened plus 2 minutes) is within 30 seconds of the end, the rest of the episode is transcribed too.
Don’t mine Nothing is fetched or mined from listens that arrive from now on. Listening time is still recorded, and mining you start yourself still runs.

Changing the choice never changes sources you already have; the status line under the select says “existing sources stay as they are”. The ? help next to Platforms explains how to rebuild sources after a switch.

Only what I watched is the cheaper choice when you often sample an episode and stop: you pay only for what you heard.

Podcasts always need transcription. Open Settings › Subtitles › Subtitle transcription:

Provider Cost estimate AutoMiner uses Key
OpenAI (Whisper) (default) $0.006 a minute (about $0.36 an hour) with the default model whisper-1 Settings › Services › API keys › OpenAI
ElevenLabs (Scribe) $0.40 an hour (scribe_v1) Settings › Services › API keys › ElevenLabs
No transcription nothing none. Podcasts are then skipped before their audio is downloaded.

The model names are under Advanced in the same card (OpenAI model, blank means whisper-1; ElevenLabs model, blank means scribe_v1). The model must return timed segments. A transcript without timestamps is stored as one untimed line, which can’t be mined.

These are AutoMiner’s estimates, not your bill. Transcription use (30 days), in the Subtitles section, lists the minutes sent and their estimated cost. A 5-minute episode on Scribe costs about $0.03; a one-hour episode about $0.36 to $0.40. If a limit under Settings › Budget would be passed, the transcription waits instead of running.

The Cost presets card on Settings › Overview changes this setting too: Free turns transcription off (so podcasts are skipped), Recommended picks ElevenLabs and Minimal picks OpenAI. Nothing changes until you save.

  1. Install the Chrome extension and save your server’s URL (http://<server>:8801) in its popup, as described in The Chrome extension.
  2. Open open.spotify.com in Chrome, signed in to your Spotify account.
  3. Play a podcast episode.

The extension reads the player every 5 seconds:

  • A listen starts when the position moves forward at playing speed between two reads (at least a second, and no more than the time that passed plus 3 seconds). Opening Spotify on an episode that is paused, or jumping to a position, doesn’t count as listening.
  • A listen ends when the episode changes, the player stops showing an episode, or a pause lasts 90 seconds. Pausing and resuming within 90 seconds continues the same listen.
  • When a listen ends, AutoMiner starts fetching the episode (see What happens after you listen).

Pause and leave the tab open for about 90 seconds before you close it. If you close the tab while it is playing, the end of the listen may be lost, and then the episode isn’t fetched on its own. You can still start it from Today (see Nothing appears, or the episode never gets fetched).

The extension’s popup shows the last event it saw (Last event, Source, Title) and whether events reached the server (Delivered to core, Not sent (no core URL)).

The web player needs no Spotify developer app. Skip step 5 if you only listen there.

The tracker reads your Spotify account through Spotify’s Web API: what is playing right now, on any device, and your recent play history. Spotify only lets an app do that after you authorize it, so you register your own small developer app with Spotify.

Run the commands in this step in a shell on the server, as the same user that runs AutoMiner (the user that ran install.sh; root for a system-wide or Raspberry Pi install). On a Windows install, set AUTOMINER_HOME and run each command through the bundled Python, as Command line shows. autominer help spotify --all lists every Spotify setting.

  1. Sign in at the Spotify developer dashboard (https://developer.spotify.com/dashboard) with your Spotify account and create an app. Any name and description will do.
  2. Add this Redirect URI to the app: http://127.0.0.1:8888/callback. You can use another one, but then you pass it to the authorize command in step 5c.
  3. If the dashboard asks which API you’ll use, pick the Web API.
  4. Open the app’s settings and copy its Client ID and Client secret.

The dashboard’s wording changes from time to time. What matters is a Client ID, a Client secret, and a Redirect URI that you can pass to the authorize command.

Terminal window
autominer secret set SPOTIFY_CLIENT_ID
autominer secret set SPOTIFY_CLIENT_SECRET

Each command asks for the value without showing it. Paste it and press Enter. It prints stored SPOTIFY_CLIENT_ID in <path> (mode 0600); restart AutoMiner to use it. Never put these values on the command line itself.

autominer setup also asks for them under “Enable Spotify tracking?”, along with the refresh token. Leave the token blank there and get it with the next step.

5c. Authorize AutoMiner to read your playback

Section titled “5c. Authorize AutoMiner to read your playback”
Terminal window
autominer spotify authorize

If you added a different Redirect URI, run autominer spotify authorize --redirect-uri <that URI> instead.

  1. The command prints an address on accounts.spotify.com. Open it in any browser that is signed in to the Spotify account you listen with, and approve. AutoMiner asks for two permissions: user-read-recently-played and user-read-playback-state. The second is the one that lets it see episodes playing on your phone.
  2. The browser then goes to the redirect address. The page usually doesn’t load, which is expected. Copy the whole address from the address bar (it contains code=), or just the code, and paste it at the address or code: prompt.
  3. On success the command prints stored SPOTIFY_REFRESH_TOKEN in <path> (mode 0600), with the scopes <scopes>. followed by Restart AutoMiner to use it. It never prints the token.

The command stores nothing when something is wrong, and says why:

Message What to do
store SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET first (autominer secret set NAME); nothing was changed Do step 5b first.
not stored: Spotify refused the code (…); open the address again for a fresh one (a code works once, for a few minutes) Run the command again and paste the new address quickly. Also check that the Redirect URI matches the one in the dashboard exactly.
not stored: Spotify granted …, without user-read-playback-state. … Open the address again and approve every permission.
not stored: Spotify said: … (nothing was approved) You cancelled on Spotify’s page. Run it again and approve.
not stored: no authorization code in what was pasted Paste the full address from the address bar after approving.
not stored: the secrets file could not be written (…) Run the command as the user that owns AutoMiner’s secrets directory.
not stored: Spotify could not be reached (…) Check the server’s internet connection and try again.

The first time all three credentials are stored, the tracker starts on its own within 30 seconds. When you change a credential later (for example after authorizing again), restart AutoMiner, because the running tracker keeps the credentials it started with:

How AutoMiner was installed Restart with
install.sh as a normal user (systemd user unit) systemctl --user restart autominer
install.sh as root (systemd unit) sudo systemctl restart autominer
install.sh on macOS (launchd) launchctl kickstart -k gui/$(id -u)/com.autominer.core
The Windows installer End AutoMiner’s pythonw.exe in Task Manager, then start AutoMiner from the Start menu
The Raspberry Pi deployment /opt/AutoMiner/deploy/safe-restart.sh

A plain systemctl restart gives a job that is running at that moment 30 seconds, then abandons it, and that job comes back as failed. safe-restart.sh waits for it instead.

Check that it runs:

  • Settings › Sources › Spotify › Account shows Credentials: Set, then Phone playback: Readable and a Last success time after the first read.
  • autominer doctor ends with a “Trackers in the AutoMiner at …” list, where spotify should be running.
  • Playback state. While an episode plays, it reads every minute (Interval while playing). Otherwise it reads every 6 minutes (Interval while stopped). So it sees a new episode up to 6 minutes after you press play, and an episode shorter than that can be missed entirely. A shorter stopped interval misses fewer short episodes and uses more of Spotify’s daily reads.
  • A phone listen ends when another episode starts, nothing is playing at a read, or a pause lasts 90 seconds. So the episode is fetched a few minutes after you pause or stop. Faster playback (up to 3.5x) counts as listening. Jumping backwards or far ahead is a seek.
  • It ignores songs, adverts, and anything playing in the web player (a device whose name starts with “Web Player”), which the extension reports instead.
  • Play history. It also reads your recently played list every 30 minutes (Play history interval). Spotify’s play history usually leaves podcast episodes out, so the playback-state reads are what find them.
  • It only sees what plays while AutoMiner is running. Because the play history usually leaves episodes out, an episode you listen to while AutoMiner is stopped is usually missed.
  • Daily limit. Every request counts, including the hourly renewal of the access token, and the count restarts at 0:00 UTC. With the defaults that is roughly 300 requests a day with nothing playing, plus about 50 for each hour you listen. From 80 % of the Daily request limit (600 by default) it reads at the stopped interval even while playing. At the limit it stops reading until 0:00 UTC. Spotify doesn’t publish how many reads it allows, so raise the limit or shorten the intervals with care: too many and Spotify refuses reads for a while.
  • Spotify asks it to slow down (HTTP 429): both kinds of read wait as long as Spotify says (never less than their own interval), then resume on their own. After other failures each read backs off, doubling up to an hour.

When a listen ends, AutoMiner queues these jobs for the episode, one after the other. If one fails, Today shows the error on the episode’s row, for example “Failed · Fetch from RSS · …”:

  1. Fetch from RSS: find the show’s feed, check its language, find the episode in it, and download its audio.
  2. Transcription: send the audio (or the heard part) to your provider.
  3. Mining: pick i+1 sentences from the transcript lines.
  4. Add definitions: fill in dictionary fields.

Podcasts skip the subtitle timing check that videos get, because the transcript is already timed to this exact audio. Consecutive transcript lines are joined into one sentence when a line doesn’t end a sentence (。, !, ?, a closing bracket such as 」, or …) and the gap is 1.5 seconds or less (up to 15 seconds in all).

AutoMiner looks up a feed for each show until it has one:

  1. If you saved a feed for the show in Podcast RSS, it uses that.
  2. Otherwise it searches Apple’s public podcast directory for the show’s name. If nothing matches, it tries again with the name cut before a “ - “, “ | “ or bracket.
  3. It reads up to 5 feeds whose name matches and takes the first that contains the episode you heard.
  4. If none of them contains it, it takes a feed only when exactly one show in the directory has exactly the same name. Otherwise it gives up and the fetch fails with 番組「<show>」の RSS URL が未設定です (“no RSS URL is set for the show”).

A feed it finds is saved for the show, so later episodes use it without searching. A feed you saved is never replaced by a search.

AutoMiner matches the episode you heard to a feed item by its title. Titles are compared ignoring case and full-width/half-width differences, and a trailing “ • ” is ignored. Otherwise the titles must be the same. When no item matches, the fetch fails with 番組「<show>」のフィードにこのエピソードがありません (<title>) (“this episode isn’t in the show’s feed”). There is no way to pick the feed item by hand.

AutoMiner decides the episode’s language from the feed’s language tag. Without one, the script of the show and episode titles decides when it clearly reads as one of your studied languages, else the languages Spotify lists for the episode (phone listens only), else the titles again. A show that isn’t in one of your studied languages is skipped before its audio is downloaded: “Not a show in a studied language, so not fetched (en)”. This protects you from paying to transcribe it. If you start the fetch yourself from Today, it is never skipped for its language: the tags are set aside and the titles decide. See Language profiles for how studied languages work.

The episode is saved under the sources folder, in Podcast/<show>/ ($AUTOMINER_LIBRARY_ROOT/MineSrc/Podcast/ by default, see Configuration). The source takes the feed’s episode title, and the feed’s cover becomes its picture. Like downloaded videos, the audio is deleted once the clips and pictures are made (Settings › Sources › Media retention; under Advanced, Override “Days kept” has a Spotify only value). When AutoMiner needs the audio again, for example to transcribe the next part of an episode, it downloads it again from the feed.

  • Today: a row for the episode with the Spotify mark. Once it has candidates, the row opens them. Before that, pressing the row starts Fetch from Podcast RSS and mine. A fetch you start this way transcribes the whole episode, even with Only what I watched.
  • Sources: the episode on a shelf named after the show, with the show’s cover.
  • Settings › Overview › How a card gets made: a Spotify row. Its Fetch stage says “Fetched from the show’s RSS” when every show has a feed, or “No RSS: · ” with a link to the Podcast RSS card. Its Subtitles stage says “Transcription”, “Transcription · up to 2 min past where you listened”, “Transcription OFF” or “Transcription key not set”.

Settings › Sources › Spotify › Podcast RSS lists every show you have heard on Spotify, plus any show with a saved feed. Each row has the show’s name, a URL box and buttons:

Button What it does
Find (only while no URL is saved) Searches Apple’s directory now, as described above. “Found and saved · fetching 2” when it finds one; “Not found · enter a URL” when it doesn’t.
Confirm Reads the URL in the box once and saves nothing. It shows the feed’s title, its number of episodes and how many of the episodes you heard it contains, for example “「Show」 · 120 episodes · 3 of the 3 episodes heard are in it”. The line is red when some heard episodes are missing, when the feed has “No episodes”, or when it is “Not a show in a studied language · Not fetched”.
Save Saves the URL (“Saved”). Every episode of this show whose fetch failed is fetched again (“Saved · fetching 2”). The URL must start with http:// or https://.
Delete Removes the saved URL (“RSS removed”). The next listen searches Apple’s directory again.

The line above the list sums it up: “No podcasts heard yet”, “2 shows without RSS” or “Every show has an RSS”.

When Confirm can’t read the feed, the message stays in Japanese in both languages: 読めません (HTTP 404) (the server answered with an error), RSS ではありません (the address isn’t an RSS feed) or つながりません (couldn’t connect).

To find a show’s feed yourself, look on the show’s own website or in another podcast app; many hosting services show an “RSS” link.

You can’t add a feed for a show you haven’t heard on Spotify: AutoMiner mines podcasts only from Spotify listens, and there is no separate “podcast feeds” source.

Some shows are only on Spotify and publish no RSS feed. AutoMiner can’t download audio from Spotify itself, so these episodes are never fetched or mined. Their listening time is still recorded on Today, the fetch stays failed with 番組「<show>」の RSS URL が未設定です, and the show stays in the Podcast RSS list without a URL.

A show can also have a feed in which some episodes carry no audio file. Those fail with このエピソードには音声ファイルがありません (“this episode has no audio file”).

Songs are never mined. A song played in the web player appears on Today as Tracked only, with its listening time. The phone tracker ignores songs completely.

In the web UI:

Setting Where Default What it changes
Mining choice (All of it / Only what I watched / Don’t mine) Settings › Sources › Spotify, in the heading All of it How much of each episode is transcribed and mined, or nothing.
Interval while playing (s) Spotify › Account › Advanced 60 Seconds between playback-state reads while an episode plays. 10 or more, under 90; at 90 or more, listening breaks into separate spans.
Interval while stopped (s) Spotify › Account › Advanced 360 Seconds between playback-state reads while nothing plays. 30 or more.
Play history interval (s) Spotify › Account › Advanced 1800 Seconds between play-history reads. 300 or more.
Daily request limit Spotify › Account › Advanced 600 Most requests to Spotify per UTC day. A whole number, 100 or more.
Feed URL, per show Spotify › Podcast RSS found in Apple’s directory Where the show’s audio is downloaded from.
Provider Settings › Subtitles › Subtitle transcription OpenAI (Whisper) Who transcribes podcasts, or No transcription.
OpenAI model / ElevenLabs model the same card, Advanced whisper-1 / scribe_v1 The transcription model.

A blank box means the default, shown as the box’s placeholder. The three intervals and the limit apply within about a minute, without a restart. If a value is also set in the server’s environment (SPOTIFY_PLAYING_POLL_S, SPOTIFY_IDLE_POLL_S, SPOTIFY_POLL_S, SPOTIFY_DAILY_READS, for example in env/spotify.env), that value wins and the box is locked with “Fixed by environment (spotify.env) — can’t be changed here”.

On the server only:

Name Default What it is
SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, SPOTIFY_REFRESH_TOKEN unset The tracker’s credentials. Secrets: store them with autominer secret set NAME (the token with autominer spotify authorize). The tracker needs all three.
SPOTIFY_STATE_FILE $AUTOMINER_HOME/state/spotify_adapter_state.json The tracker’s state: the current listen, today’s request count, the last read and failure.
SPOTIFY_STATE_KEEP 500 How many forwarded plays it remembers, so none is sent twice.
SPOTIFY_BACKOFF_CAP_S 3600 The longest wait after failed reads.
AUTOMINER_TRACKING on 0 runs no tracker at all. Use it on a test copy that holds your real credentials.

See Configuration for how environment settings and secrets are stored.

Settings › Sources › Spotify › Account reads the tracker’s own state, never Spotify, so looking at it costs no requests. Its rows:

Row What it can say
Credentials Set; “Only partly set up — …” (one or two of the three are stored); “Not set — …”.
Reads “Never read yet”: the tracker has never run. Check the credentials, that AutoMiner was restarted, and autominer doctor.
Phone playback Readable; “Authorize again — Run autominer spotify authorize on the Pi, allow it as shown, then restart the importer”; “Unknown (the last read failed)”.
Last success When a read last worked.
Last error None, or when and why, ending in “ (reads have worked since)” once it recovered.
Requests today For example 212 / 600, with “ — limit reached: no reads until 0:00 UTC” at the limit.
Read intervals For example “playing 60 s · stopped 6 min · play history 30 min”.

Nothing appears, or the episode never gets fetched

Section titled “Nothing appears, or the episode never gets fetched”
  • Spotify isn’t installed. Listens are dropped until it is. Do step 1.
  • Web player: the extension has no server URL. Its popup counts Not sent (no core URL). Save the URL in the popup.
  • Web player: the listen never ended. Leave the tab open about 90 seconds after pausing. If it’s already lost, press the episode’s row on Today to fetch and mine it.
  • Phone: the episode was shorter than the stopped interval, or AutoMiner wasn’t running while you listened. Lower Interval while stopped (s) if you often listen to short episodes.
  • The mining choice is Don’t mine. The How a card gets made row then says “Not mined — nothing is fetched from new watches”.
  • The episode has no show name (rare, in the web player). Pressing its row says “This podcast has no show name, so its RSS feed cannot be found”.

The fetch fails with 番組「<show>」の RSS URL が未設定です, and the Fetch stage says “No RSS: ”.

  1. Open Settings › Sources › Spotify › Podcast RSS.
  2. Press Find. If it says “Not found · enter a URL”, find the feed URL yourself, paste it, press Confirm, then Save.
  3. Saving fetches the failed episodes again.

If the directory filled in a different show with the same name, Confirm shows few or none of your heard episodes in it. Paste the right URL and press Save.

The fetch fails with 番組「<show>」のフィードにこのエピソードがありません (<title>).

  • The episode may be too new or too old: some feeds list only recent episodes, and some add an episode later than Spotify does. Once the feed has it, press Save on the show again (with the same URL) to retry the failed fetches.
  • The feed may name the episode differently from Spotify. AutoMiner can’t match it then.
  • The feed may be for another show (see above).

“Not a show in a studied language, so not fetched ()” means the feed or the titles say another language. If the show is really in a language you study, press the episode’s row on Today: a fetch you start yourself decides by the titles instead of the feed’s tag. Check your studied languages under Settings › Languages.

  • “Transcription OFF”: Provider is No transcription. Pick OpenAI or ElevenLabs and save.
  • “Transcription: OpenAI (Whisper) API key not set” (or ElevenLabs) on the episode’s row: add the key under Settings › Services › API keys.
  • The Subtitles stage shows a budget message: a limit under Settings › Budget holds it.
  • “This episode was already fetched as another source”: the same feed episode already belongs to another source.
You see Why What to do
Phone playback: “Authorize again …”, or the Fetch stage says “Authorize Spotify again to bring in shows heard on the phone (the web player works)” The refresh token lacks user-read-playback-state, or Spotify refused the playback-state read. Run autominer spotify authorize, approve every permission, restart AutoMiner. Web player listens keep working meanwhile.
Last error: “Spotify refuses the authorization — authorize again” The refresh token no longer works, for example because you removed the app’s access in your Spotify account, or the client secret was changed. If you changed the client secret, store the new one with autominer secret set SPOTIFY_CLIENT_SECRET. Then run autominer spotify authorize and restart AutoMiner.
Last error: “Spotify paused reading for now — it resumes on its own” Spotify answered 429 (too many requests). Wait. If it happens often, lower the Daily request limit or lengthen the intervals.
Last error: “Can’t read Spotify’s play history” Another failure, such as no network. It retries with growing waits. Check the server’s connection.
Requests today ends with “limit reached” The Daily request limit is used up. It resumes at 0:00 UTC, or raise the limit.
Credentials: “Only partly set up” One or two of the three secrets are stored. Finish steps 5b and 5c. autominer secret list shows which are set.

Access tokens expire every hour. The tracker renews them by itself with the refresh token, so an hourly expiry needs nothing from you.

If the Account card looks fine but nothing new arrives, run autominer doctor. In its tracker list, spotify paused: <error> means the tracker crashed and waits for a restart of AutoMiner. Settings doesn’t show this state yet (issue #1528). spotify standby: another AutoMiner on <home> is tracking spotify means a second AutoMiner using the same data folder already runs the tracker. No spotify line means the tracker isn’t running: check that Spotify is installed, all three credentials are stored, and AUTOMINER_TRACKING isn’t 0.