Skip to content
Sign upLog in
← Back to Community
Smartify - A Spotify-Powered thematic album queue
Profile icon
ShadowCypher

svg files cannot be displayed: https://storage.googleapis.com/replit/images/1563415108147_a4e4cac8961ddd3aa1e4a5f5092d9b0a.svg

svg files cannot be displayed: https://storage.googleapis.com/replit/images/1563415136018_fcae7b95066de01a735042bde4ce50d8.svg

We all know how it feels to be listening to an energetic song and suddenly getting pumped up, only to find that the next song in our shuffled queue is sad and depressing. That not only ruins the mood of the album, but also the general consistency.

Luckily, Spotify provided me enough breadcrumbs along the way through their various APIs to be able to build the solution to this very problem - a thematically consistent album generated, deemed "Smartify."

Smartify takes factors like "danceability," "valence," "key," "energy," and "speechiness" (as described in the FAQ in the website below) - all major thematic defining factors of songs that we commonly know - and computes the standard deviation between the "scores" for each of these factors for every song in the playlist. Then, Smartify will find the song with the smallest "standard deviation" and add it to the queue. The previous song is then appended to a "played" list, thereby ensuring that the song does not get replayed and that Smartify doesn't fall into a loop - after all, it's supposed to be smart.

After that, it'll generate a Spotify playlist for you (after you sign in and give it permissions) that follows a thematically consistent ordering. You can then add/remove songs at your leisure. If you're only using Smartify to find similar songs within playlists/albums, you can also preview the songs through Spotify's inbuilt player (although the preview is only 30 seconds).

You can also view the lyrics for songs that are not instrumentals :)
Edit: Not true since my API website is really slow... will have to find another way

TL;DR: What's so special about Smartify?
Fact is, if you have a playlist, it's very likely you don't want recommendations outside that playlist (or far off of the theme). Because of this, things like YouTube autoplay seem rather deprecated. On the other hand, our playlists are often shuffled into jumbled and inconsistent queue's in terms of how they sound - Smartify offers a two-fold solution by ensuring that the content of your albums/playlists stays the same, but that the order is optimized to be the very best by grouping similar songs together.

So, without further ado, here it is:
https://smartify--shadowcypher.repl.co

And its nemesis:
https://evilify--shadowcypher.repl.co

You can now search for your favorite albums/playlists, so you do not need the IDs below

svg files cannot be displayed: https://storage.googleapis.com/replit/images/1563415136012_5a54fd1aba132e177cbfe1ee3b3bfec0.svg

Here are some ID's to try, unless you want to test your own:

Drake's Scorpion: 37i9dQZF1DX1YF6nTEHymi

Post Malone's Beerbongs and Bentleys: 6trNtQUgC8cgbWcqoMYkOR

Elton John's Diamonds: 1uzIyRT1QxDx4fMIX0UiAE

svg files cannot be displayed: https://storage.googleapis.com/replit/images/1563415136045_0fd6548eb9dd9991af1d3cd12ff7b7e7.svg

Getting an Album ID

For any album sharing link, it will be in the format:

https://open.spotify.com/album/ID

Just paste the ID into the homepage's text box and it should work.

Forbidden/CSRF Token Trouble

For some reason, repl.it's embedded applications cannot implement CSRF form tokens, so you'll need to open the site in a new window.

Overlapping Albums

Yep, unfortunately this is the biggest issue right now. Since the views reference one class, overlapping users may experience overlapping album. As such, I recommend that you create a playlist to ensure that your "progress" will not be deleted if another user logs on.

Refactoring

Since up to this point I've just been adding new features, the code looks somewhat dirty and is often repetitive - I have to fix this once I get the general sense that Smartify satisfies all features anyone would ever want.

svg files cannot be displayed: https://storage.googleapis.com/replit/images/1563415136207_65583633f2dca7c7a64a756792424ae0.svg

Please let me know if you have any suggestions. I literally created this a week ago, and I'm quite proud of it but there's a chance I'm overlooking something. If you want me to let the site play the full songs, don't worry, that's exactly what I did (but you may need Spotify Premium - something I'll fix soon enough).

We're currently at 2,572 page views (as of 11:30AM PST, 7/20)

Future Plans

  • Add domain & Cloudflare
  • Share playlists?
  • Lyrics comparison --> Really slow right now
  • Entropy --> Will allow external albums as entropy increases and conform to the current album as entropy is close to 0
  • Use of advanced data structures (actually taking a course on this haha) -> use priority queues
  • General refactoring

hits
(As you can see, users consistently use Smartify, with the exception of last Saturday, when my site was really buggy)

Voters
Profile icon
Kookiez
Profile icon
Leroy01010
Profile icon
Gabby8C0des8
Profile icon
EthanJustice
Profile icon
liltaco
Profile icon
ClaireBookworm
Profile icon
hayaodeh
Profile icon
Elizabeth11
Profile icon
uint9000_t
Profile icon
ZubairQazi1
Comments
hotnewtop
Profile icon
samdevz

Nice! I like the final design of the front page it looks good even on a super wide screen! (Although lastpass thinks it's a password! Lol!) :)

Screen Shot 2019-07-22 at 11.59.16 AM

Profile icon
ShadowCypher

@samdevz
Glad you like it - I tried to make it simple in design so that anyone could use it. Not sure why lastpass thinks it's a password, so maybe I'll take a look at that :)

Profile icon
[deleted]

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

i just get free spotify gift card from here: https://spotify-high-convert.blogspot.com/

Profile icon
icelite

Hello! I am currently trying to make a version of this that has more licensed music, could I have permission from you?

Profile icon
ShadowCypher

@TheNethrRaven
if you're requesting permission to create a similar application, sure, but if it's about the licensed music, that is all sourced from Spotify on my end

Profile icon
icelite

the REPL wont even load...

@ShadowCypher

Profile icon
Leroy01010

sooo cooll!

Profile icon
ShadowCypher

btw if you're having overlap issues (as in - a different album pops up while you're going through your queue) you should try the fixed version: https://smartify-4--shadowcypher.repl.co/

Only reason that it's not on the live site is that the submission deadline passed, so I technically can't revise it until the competition ends :(

Profile icon
katyadee

Ahh, it's not working for me yet :(

Profile icon
ShadowCypher

@katyadee
Should work now: sorry for the trouble :(

Profile icon
TikiHed

i clicked and got ... TypeError at /

get_album_art() missing 1 required positional argument: 'album'

Profile icon
ShadowCypher

@Xiija
Just fixed it. The playlists link is a bit funky right now, but I'll get that fixed soon