# Spotify Integration SPOT TO SB

**URL:** <https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662>\
**Category:** Approved\
**Tags:** obs, chat, twitch\
**Created:** [December 27, 2023, 10:20pm UTC](https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662 "2023-12-27T22:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lebluxtv](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/lebluxtv/32/287_2.png) [@lebluxtv](https://extensions.streamer.bot/u/lebluxtv)\
**Post date:** [December 27, 2023, 10:20pm UTC](https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662/1 "2023-12-27T22:20:05Z")

</div>

# Description

A Spotify integration for Streamer.Bot

WILL BE DEPRECATED FOR STREAMER.BOT 1.0.0

_OBS WS v5.x_

## ChangeLog (v0.4)

[Quality Of Life]

- Introducing User Interface for the Configuration.
- Option: Automatically start spotify desktop if not started yet.
- Custom Triggers for a bunch events. ( Play / Pause / New Song / Volume Changed / New Request )

[Improvement]

- Song request now accept spotify links.
- Song request now display who reqested the song if showing it in chat.
- Command to save current song to a Selected Playlist ( !sAdd )
- Ability to save requested songs to a dedicated playlist
- Command to requeue the current Song ( !sReplay )

[Optimization]

- Complete rework for API call methods ( httpWebRequest → httpClient ).
- Don’t use any CPH.SetGlobalVar methods in the watcher

[OBS overlay]

- No more streamFX

 ![image](https://extensions.streamer.bot/uploads/default/original/2X/c/c3554b49fb64cf95a870b56c707378bde546b03a.png)

# Import File

[SPOT\_TO\_SB\_0.4.17.sb](https://extensions.streamer.bot/uploads/short-url/udsyH65uYlCPixz0gUEY6qjLBwX.sb) (172.4 KB)

If you already have a previous version or any other spotify extension, remove all Actions and Commands before importing to avoid conflicts, or reaching API limits.

> **How To Remove All Variables**
>
> Click the Variable Viewer ![image](https://extensions.streamer.bot/uploads/default/original/2X/5/55a899aa5467b3d9fe3048daced63b87f8b02ba4.png)
> 
> In the Filter write `_sp2sb` so you will be able to erase them all from here.
> 
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/a/a5f2b2b156a00eafeff613ae97f2fdabd09a6368.png)

## First Run : installation

> **Instruction (click to expand)**
>
> In order to get full functionality like song request [command !sr] to add song to song queue , you MUST be premium spotify user. it’s not only because not being premium will cast ads too, but it’s also spotify API limitation.  
> Open your desktop application during the process so it will be recognized by Streamer.bot on the first connection.
> 
> - streamer.bot import code : click on import , then drag and drop spot2sb.sb file to the import string field.  
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/2/261cd6e8c03921b711a5f5116781cfcef572b7ae.png)
> 
> - go to Commands tab, right click on the `spot2sb` group name, on Group, go to Enable All  
> 
> - you can now use !spotifyConnect command to configure everything.  
> 
> - In order to makes it working, you need to create a “spotify application”. This will give you the Client Id and Client Secret needed to interact with your account.
> 
> - Click on the link on Top Right Corner ![image](https://extensions.streamer.bot/uploads/default/original/2X/8/8984ca67c9b839112e8724e2538d7d9c9327b01e.png)
> 
> - You may need to connect with your spotify account with the `Log in` button on top right of the page  
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/8/8a95f575eb8359ab2d29019541550c1906954851.png)
> 
> - Then after being logged, you can go back to that button to jump into your dashboard.  
> 
> - if you have never made any application yet , you will need to create one from the `Create App` button  
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/1/19cc7109305ba530e8951008ca197a97b2e5c2ed.png)
> 
> - you will need to give a name and a short description  
> 
> - then paste `http://127.0.0.1:1300/spotifyOAuthRedirectUri/`  
> [_if you used the link from the U.I. that link is already copied in your clipboard_]  
> to the redirect uri field click the `add` button  
> paste again and modify the port number to 1301 on the second redirect uri link so it will looks like this [http://127.0.0.1:1301/spotifyOAuthRedirectUri/](http://127.0.0.1:1301/spotifyOAuthRedirectUri/) , click add.  
> now it should looks like this :  
> 
> - don’t forget to tick the terms agreement and press save 
> 
> - you will then get into your dashboard of that application. click on the `settings` button. ![image](https://extensions.streamer.bot/uploads/default/original/2X/9/99fc6f7df46b64f85e81cc69f6d006897f54834f.png)
> 
> - there, just copy your clientId by clicking ![image](https://extensions.streamer.bot/uploads/default/original/2X/5/5ce89a5be9f9164e6a0d88fed1237ddf281103cb.png) ![image](https://extensions.streamer.bot/uploads/default/original/2X/d/d1e0ad13b68b05d770c8a7b22a7db49b8c6c03af.png)
> 
> - then right click on the U.I. in the clientId field , it will directly copy it.  
> 
> - to get your clientSecret click on View client secret 
> 
> - copy it the same way using ![image](https://extensions.streamer.bot/uploads/default/original/2X/5/5ce89a5be9f9164e6a0d88fed1237ddf281103cb.png)  
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/4/4f6385a396a5bc670532c05aeba7fa233d9fea4c.png)
> 
> - then right click on the U.I. in the clientSecret field , to copy it.  
> 
> - you can now use the `Connect` Button  
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/3/3d036a817725a8eae8bd7f39fbff43ed3813883d.png)

## Configuration

> **(click to expand)**
>
> Select Device
> 
> ![2024-03-23_01-13-45](https://extensions.streamer.bot/uploads/default/original/2X/1/14af258399eabf0436d6eeafedc93acc9528df43.png)
> 
> Select Playlist
> 
> ![2024-03-23_02-49-54](https://extensions.streamer.bot/uploads/default/original/2X/a/aee2f869addd1fbebef8390884f3c9569ff29d43.png)
> 
> Toggle Buttons & Crossfade
> 
> ![2024-03-23_02-56-22](https://extensions.streamer.bot/uploads/default/original/2X/4/418d7ee9f1bee0f8db091c44eed8d9c78ba0b334.png)
> 
> OBS Overlays  
> Make sure to be connected to OBS, and having most recent OBS plugins required.
> 
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/c/c910564d0f2590f01aba76b01f6f70177a1b4821.png)
> 
> OBS Plugins  
> Links to download plugins needed.
> 
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/0/0ae3ec2f8558b16099944ee4f32f37fea0ff0f36.png)
> 
> Edit Messages  
> Change most common messages to fit your langage.
> 
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/e/e8ef91907e0b7f38448d9ca1a12b73d518080302.png)

## Available Commands

> **(click to expand)**
>
> | Command | Parameters | Permission | Purpose |
> | --- | --- | --- | --- |
> | `!spotifyConnect` | | moderator | First Command to Enable and run to start the U.I. |
> | `!sPlay` | | moderator | play / resume |
> | `!sPause` | | moderator | Pause the song [won’t stop the progress bar from the actual method used] |
> | `!sNext` | | moderator | Next Song in Queue |
> | `!sPrev` | | moderator | Previous Song |
> | `!sQueue` | optional number up to 10 queued elements | all | Display in chat the next song that will be played right after the current one. |
> | `!sr` | songName + artistName OR spotify Link | all | Will add the result to the queue. |
> | `!sLike` | | moderator | To Save a song to your Liked songs. |
> | `!sLink` | | all | Let your viewers get the spotify Links. |
> | `!sNow` | | all | Will post to chat the currently playing song ( useful if you choose to not display the song on song change and/or not displaying the overlay ) |
> | `!sReplay` | | moderator | Add the currently playing song to the queue |
> | `!songOut` | | moderator | Will exclude the ability to add the currently playing song from song request |
> | `!excludedSongs` | | moderator | Will display every songs added to the banned song list. e.g. : 1 songs excluded 0 songName artistName |
> | `!songBack` | number corresponding to excludedSongs number | moderator | by the number returned by one of the responses from `!excludedSongs` |
> | `!sVol` | Number between 0 and 100 | moderator | change the volume of the player in percentage |
> | `!sAdd` | | moderator | Add currently playing song to selected playlist in the U.I. |
> 
> example :
> 
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/1/15ca19238ff3d7065566a2ddde1ae8ac966dbc07.png)

## Custom Triggers

> **(click to expand)**
>
> ![image](https://extensions.streamer.bot/uploads/default/original/2X/8/8694c03b2c1ee66cb2e5cc70486e2dc1aa34d6f8.png)
> 
> | Trigger Name | Variables | Type | info |
> | --- | --- | --- | --- |
> | Play | %songState% | string | “playing” |
> | Pause | %songState% | string | “paused” |
> | New Song | %songName% | string | |
> | | %artistName% | string | |
> | | %albumArt% | string | url |
> | | %songDuration% | int | millisec |
> | | %songLink% | string | url |
> | Volume Changed | %volumeLevel% | int | between 0 & 100 |
> | New Requested Song | %requestedSong% | string | |
> | | %requestedArtist% | string | |
> | | %requesterName% | string | |
> | | %requestedAlbumArt% | string | url |
> | | %requestedSongLink% | string | url |

## OBS Overlay’s Requirements

> **(click to expand)**
>
> - If you only use it to display new songs in chat, or only use html overlay, you don't need any OBS plugins. - If you want to use the song request function, you need a premium account.
> 
> plugins needed : ( OBS Overlay only )
> 
> | Plug-in Name | Aditionnal Informations | Link |
> | --- | --- | --- |
> | `Source Copy ` | _Importation of scenes, sources and filter_ | [Source Copy | OBS Forums](https://obsproject.com/forum/resources/source-copy.1261/) |
> | `Win Capture Audio` | [ACS] Audio Capture   
> _Check the properties for [ACS] Audio Capture and set it to be listening to your active spotify.exe window._ | [win-capture-audio | OBS Forums](https://obsproject.com/forum/resources/win-capture-audio.1338/) |
> | `WaveForm` | Waveform Visualizer   
> _Check properties of this source to make sure it listen to the Audio Capture source._ | [Waveform | OBS Forums](https://obsproject.com/forum/resources/waveform.1423/) |
> | `ShaderFilter` | used for the Progress Bar | [obs-shaderfilter | OBS Forums](https://obsproject.com/forum/resources/obs-shaderfilter.1736/) |

### Q & A

- _Can I use Amuse overlay with that extension ?_  
Yes, but you must be using a separated app.

# Contributors

- [ConfuzzedCat](https://www.twitch.tv/ConfuzzedCat) Who first initiate that project
- [HappyPlotter](https://www.twitch.tv/HappyPlotter) Who pointed me in the right direction
- [Exeldro](https://www.twitch.tv/exeldro) Who Kindly added the Vendor Event for Source Copy
- [IK](https://www.twitch.tv/ik1497) For the websocket overlay
- [Rondhi](https://www.twitch.tv/rondhi) For the Radial Fill Shader
- [Pwnyy](https://www.twitch.tv/pwnyytv) For his many valuable advices
- Thx for all testers too. [TerrierDarts](https://www.twitch.tv/TerrierDarts) | [Jesus\_Pals](https://www.twitch.tv/jesus_pals) | [Tawmae](https://www.twitch.tv/tawmae) | [Lyfesaver74](https://www.twitch.tv/lyfesaver74)

---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [March 2, 2024, 11:16pm UTC](https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662/2 "2024-03-02T23:16:52Z")

</div>

Unlisted on March 2, 2024, 11:16pm UTC



---

<div class="post-metadata">

**Author:** ![GoWMan](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/gowman/32/4_2.png) [@GoWMan](https://extensions.streamer.bot/u/GoWMan)\
**Post date:** [March 3, 2024, 12:03am UTC](https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662/3 "2024-03-03T00:03:35Z")

</div>

Listed on March 3, 2024, 12:03am UTC



---

<div class="post-metadata">

**Author:** ![TerrierDarts](https://extensions.streamer.bot/user_avatar/extensions.streamer.bot/terrierdarts/32/8_2.png) [@TerrierDarts](https://extensions.streamer.bot/u/TerrierDarts)\
**Post date:** [March 23, 2024, 12:22am UTC](https://extensions.streamer.bot/t/spotify-integration-spot-to-sb/662/4 "2024-03-23T00:22:51Z")

</div>

Changes Requested made to Docs, Still Incomplete

Extensions its self seems to work fine.
