Skip to content

Instantly share code, notes, and snippets.

@d3v1an7
Last active September 6, 2020 09:12
Show Gist options
  • Save d3v1an7/1ca8101f307bf958fefe5b091b35501b to your computer and use it in GitHub Desktop.
Save d3v1an7/1ca8101f307bf958fefe5b091b35501b to your computer and use it in GitHub Desktop.
Now Playing for Spotify in OBS/Streamlabs OBS via Snip
<div id="container">
<img id="cover" src="Snip_Artwork.jpg" />
<div id="text">
<div id="track"></div>
<div id="artist"></div>
</div>
</container>
<style>
body {
background-color: rgba(0, 0, 0, 0);
margin: 0 auto;
overflow: hidden;
font-size: 10px;
}
#container {
background: rgba(0, 0, 0, .8);
border-radius: 15px;
display: flex;
flex-flow: row nowrap;
height: 100%;
width: 100%;
}
img {
border-radius: 15px 0 0 15px;
height: 100%;
margin-right: 4%;
width: auto;
background: url("https://developer.spotify.com/assets/branding-guidelines/[email protected]") no-repeat;
background-size: cover;
}
#text {
align-self: center;
color: #fff;
display: flex;
flex-flow: column nowrap;
font-family: "Lato", sans-serif;
font-size: 1rem;
margin-right: 4%;
}
#artist, #track {
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
display: -webkit-box;
overflow: hidden;
}
#artist {
margin-top: 3%;
}
#track {
-webkit-line-clamp: 2;
font-size: 1.3rem;
font-weight: 700;
}
</style>
<script src="https://unpkg.com/jquery"></script>
<script>
setInterval(function() {
var cachebuster = new Date().getTime();
var image = document.getElementById("cover");
image.src = "Snip_Artwork.jpg?time="+cachebuster;
// This doesn't work in a browser, but it works in OBS!
$("#track").load("Snip_Track.txt", function() {
if($(this).is(":empty")) {
$(this).text("Paused");
}
});
$("#artist").load("Snip_Artist.txt");
}, 1000);
</script>
@d3v1an7
Copy link
Author

d3v1an7 commented Sep 6, 2020

How to use

  1. Download latest version of Snip (7.0.5 at time of writing)
  2. Unzip Snip into the directory you'd like it to live
  3. Download this file, and put in the same directory as Snip.exe
  4. Run Snip.exe, authenticate with Spotify, then right click on the icon in your task bar to configure your settings

My settings

snip1

snip2

Any streaming software that supports a "Browser source" (such as OBS, Streamlabs OBS, etc) will now be ready to go!

obs

GLHF :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment