10 ms·
Terraform Provider for Spotify
- metadat 4y agoThis seems like insane overkill, but I'm totally going to give it a whirl tomorrow. I wonder if there is a provider implemented for Deezer..
- MattIPv4 4y agoEvery time I see an integration with Spotify built for a single user to run themselves, it pains me that you have to setup an OAuth application and server to get a token for your own account. I just wish Spotify would let you generate tokens for your own account, so you can properly automate playlists etc.
- izzygonzalez 4y agoCan you automate token generation? The repo uses a middleware server. I'm wondering what other approaches there are.
- deleted 4y ago[deleted]
- beart 4y agoYes! Just last weekend I threw together a quick project to create a Discord bot that adds all spotify links to a playlist. It was smooth as butter until I got to the Spotify Auth flow. Decided it wasn't worth the time at that point.
- conradludgate 4y agoI provided a proxy service[0] to do the oauth handling. It gives you a permanent token that let's you access your up to date oauth tokens, of course with the caveat that you have to trust me. This is not really a scalable solution. I wanted to try and get the terraform provider to handle the oauth flow but it's tricky because of the way terraform providers run [0] https://github.com/conradludgate/oauth2-proxy https://github.com/conradludgate/oauth2-proxy
- krageon 4y agoCan't you just MITM a login and use the login token? The login flow never materially changes (it's always the same two credentials), that seems like way less of a pain than whatever this OAuth flow is supposed to be.
- MarcelOlsz 4y agoI've been using Swinsian on my desktop connected to a NAS. It has an sqlite DB that I backup with git to never lose my play counts. I save and sync playlists to a "playlists" folder in my music folder. When my NAS phone app (DS Audio) launches, it syncs all my playlists. I have scripts set up to make new smart playlists for me when a new artist is added, so I'll have an "unlistened" smart playlist, a listened one, and a bestof, for each artist. I downloaded a huge discography of Bach years ago and I'm still making my way through it. I have full control of all my tracks, playlists, playcounts, and any other metadata I want, all backed up to git. Spotify will never defeat this for me. I tried using Spotify and downloaded the free version, and was physically disgusted at the "6 free skips per day!" or something, not to mention random songs being unavailable.
- they4kman 4y agoI just want a tool that syncs all my Liked songs into a playlist, so I can use Playlist Radio with it.
- lambdaba 4y agoI think you could use soundiiz.com for that.
- llanowarelves 4y agoSoundiiz is great. Only way I was able to get my playlists exported as CSVs
- leodriesch 4y agoIf you got Spotify on desktop you could just select all your liked songs and drag them onto some other playlist. Should work multiple times, just click „don’t add“ when it asks you if you want to add duplicate tracks.
- pacifika 4y agoI tested and created a IFTTT recipe for this: https://ifttt.com/applets/iMnNGt3V-backup-spotify-likes https://ifttt.com/applets/iMnNGt3V-backup-spotify-likes Despite the incorrect labelling "Saving a spotify track" means liking it, not "downloading to your device". So you can add it to another Spotify playlist. To get historical likes, cmd-a / ctrl-a (or equivalent) all Liked Songs tracks and drag them into the backup playlist.
- bayareabadboy 4y agoBut… why?
- rendaw 4y agoYou can manage your playlists with version control.
- pc86 4y agoSome men see things as they are and ask why. Others dream things that never were and ask why not. - George Bernard Shaw
- Spivak 4y agoSo you can maintain your “feeling cute might take down production later” playlist in the same repo as your infrastructure.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- llanowarelves 4y agoBecause it's funny
- fnordpiglet 4y agoI’ve always wanted immutable reproducible play lists.
- andrewstuart2 4y agoIt's really more about maintainable playlists, tbh. How are you going to scale your playlist management if you can't properly review changes and see history to avoid repeating mistakes of the past?
- rgoulter 4y agoYeah, maintainability is key. A lot of people like just managing playlists with a simple graphical console. This works fine if you just want a playlist now, but you risk things like forgetting why the songs were added to a playlist; or forgetting which songs were in a playlist if the playlist accidentally got deleted. Sure, describing it with Terraform may be more effort up front, but it saves effort in the long run.
- conradludgate 4y agoAuthor of the provider here! I've been maintaining a sync of my Spotify liked songs for a while now using this terraform provider: https://github.com/conradludgate/spotify-library https://github.com/conradludgate/spotify-library I wanted to add a way for it to get the song names in there, but I never got around to it
- hiptobecubic 4y agoback in the day we called them "playlists"
- fnordpiglet 4y agoThat was clearly before autocorrect told you you were wrong
- deleted 4y ago[deleted]
- wellthisisgreat 4y agoAt this point I am quite invested in the Spotify algorithm and am happy with its recommendations and discovery. Does anyone have any interesting hacks / improvements to vanilla Spotify experience? Some must-have apps or such? This one doesn’t seem to do anything in particular a Spotify app couldn’t do
- Spivak 4y agoEverynoise is hands down the best tool to figure out the really specific name for your music tastes and find more people like it.
- tommywg7 4y agoI’m actually building an app to allow more precise control over the algorithm. https://tommygeiger.com/tuner https://tommygeiger.com/tuner Would love some feedback!
- d-sc 4y ago1) that was fun. The explanations next to each parameter are helpful to know what each slider modifies. 2) the way you advertise your app and ask for feedback is welcoming. It feels honest.
- zack6849 4y agoI just checked this out and it's fantastic, I wish this was exposed by default somewhere in Spotify, amazing app, thanks a ton for making this and sharing!!
- miller_joe 4y agoThis is great!
- vsnf 4y agoSpotify makes me so, so sad. I say this as a premium customer since 2015. They push out a mobile app update every week with either no changes, or changes to things I don't care about. They removed push-to-preview. They refuse to add custom song start and end times. They focus incessantly on podcasts. Their playlist management is a joke. They get the most embarrassing things wrong, like failing to understand that two artists with the same name are not the same artist, or that a song in my Discover Weekly is just a re-release of a song already in my library. Until recently, their random shuffle kept getting stuck in a loop of ~100 songs. There is no modification history, so if I accidentally remove a song from a playlist or my library, I get a snackbar saying "Removed from library" but it won't tell me what, and there's no way to find out. Their song queue system is utterly anemic. The "Home" button also serves as a kind of pseudo "back button" but with no obvious rules to understand exactly how navigation is going to occur. The fact that so many third party Spotify integrations exists, each tackling a different deficiency in the Spotify app itself speaks volumes about what Spotify's priorities are. Spotify is lucky that their library is massive and that their recommendations are good (for me anyway. My friend and my mother separately have had astoundingly awful experiences with the recommendation system despite years of trying), or there's be no love lost in moving elsewhere.
- cyral 4y agoMy biggest UI annoyance is that you cannot sort by newest added when viewing a playlist on mobile (you can on desktop). So if you just added some songs to a playlist and want to listen to them first (I find myself doing this all the time when getting into my car), you have to spend 20 seconds scrolling frantically to the bottom of the list to find them. Let me know if I'm missing something.
- zwirbl 4y agoAt least on the current Android version it's actually possible, it seems to not be available in the browser version though
- lcfyi 4y agoI know this exists in Android: you can pull down at the top of a playlist to reveal the search bar and sorting options. The sorting options should include recently added.
- bovermyer 4y agoTerraform is for specifying deterministic, idempotent results given a set of conditions and inputs. Music apps like Spotify and Apple Music are about whimsical, serendipitous discovery independent of rational thought. At least, for me, anyway. The two are wholly incompatible. I'm shocked that this exists. It calls into question how I think of music streaming platforms, what I think they provide, and how I interact with them.
- deleted 4y ago[deleted]
- 0xbadcafebee 4y agoTerraform is just an overcomplicated way to call APIs. It's not deterministic and idempotent, as if you're "doing it right" you don't even know what values it's going to apply until after it's applied them. It can't be idempotent because Terraform doesn't determine if an API call will succeed or fail or do the same thing or not, the SaaS API does. And if you change anything, it can trigger a destroy, a create-destroy, a destroy-create, a create, or a modify, all of which may fail if the provider's resource wasn't designed for that particular operation with those values, which you won't know until it actually happens. Debugging it is a nightmare, and the bizarre interaction with pretty shoddy and inconsistent providers makes it pretty lucky if your applies actually work. It's basically an annoying version of curl that has a DAG that you can't even make good use of. I wouldn't call it whimsical, but getting anything to work in Terraform consistently definitely requires serendipity.
- mauflows 4y ago> as if you're "doing it right" you don't even know what values it's going to apply until after it's applied them. It can't be idempotent because Terraform what do you mean by this? 'terraform apply' runs plan first, and tells me the diff from the expected state. Then it asks me if I want to reconcile it. I agree with the rest tho
- 0xbadcafebee 4y ago
- ecliptik 4y agoI use this to generate MiniDisc playlists to record using the SynchoRec feature to automatically add track markers. I wanted an automated way to add silence between tracks in an album and generate a easy-to-parse file to potentially write metadata from. You can see an example of it here: https://open.spotify.com/playlist/1z3LtkicovnnGJ6hdcrzSi?si=65f1da7a61c44d5b https://open.spotify.com/playlist/1z3LtkicovnnGJ6hdcrzSi?si=... Code is here: https://github.com/ecliptik/minidisc-playlist https://github.com/ecliptik/minidisc-playlist This was originally part of "Build Your Summer Playlist" [1] promo Hashicorp ran last summer, which they still have yet to announce winners... 1. https://www.hashicorp.com/blog/build-your-summer-spotify-playlist-with-terraform https://www.hashicorp.com/blog/build-your-summer-spotify-pla...
- mherdeg 4y agoOK so I'm a little puzzled by this demo (https://learn.hashicorp.com/tutorials/terraform/spotify-playlist https://learn.hashicorp.com/tutorials/terraform/spotify-play...). The example directive "spotify_search_track" runs a server-side search on Spotify and returns a list of results, which you can use to populate a playlist. This is like … very cool, but also isn't it a little against the spirit of immutable infrastructure? Every time Spotify re-ranks their search results my terraform apply will populate different songs into my playlist, without anything changing in my main.tf in source control.
- electroly 4y agoMaybe, but the official serious providers do stuff like this, too. Consider the feature that lets you automatically use the latest Linux or Windows AMI; it changes without you touching your .tf file.
- caymanjim 4y agoThere's nothing that says it has to be immutable. It's not uncommon to perform similar searches in e.g. AWS to select the latest version of some AMI or another resource that is subject to change, and applying with no changes to the Terraform code would update the resource. This isn't really "infrastructure" either. It's a neat use case.
- cube2222 4y agoMoreover, you can pair it with drift detection (available in i.e. Spacelift[0]), and have it automatically detect when a data source changes (and apply the resulting infra changes). Very common scenario with lots of neat use cases around it. One of the more interesting ones - use a GitHub pull request listing data source to create an ephemeral environment for each PR. Disclaimer: Software Engineer at Spacelift [0]:https://spacelift.io https://spacelift.io
- darkwater 4y agoJust received (I hope it was by chance) a cold mail from your company today. If I might be interestes by your post here, now I'm not anymore.
- julianbuse 4y agothis is brilliant
- waingake 4y agoI'm not exactly sure what this is doing. I've made a service that scratches my own itch of wanting a way to sort a collection of playlists by the last time they were updated. I've got that running here, and I use it often. https://playlists.mohiohio.com/ https://playlists.mohiohio.com/
- conradludgate 4y agoOh hey! I wrote this :D AMA
- vineyardmike 4y agoCool work! Good job - I love projects where asking "why?" a good response is "why not?", but I gotta ask... why? Also, how long did it take? What was the inspiration?
- conradludgate 4y agoA more detailed "why" can be found in the interview I gave: https://www.hashicorp.com/blog/build-your-summer-spotify-playlist-with-terraform https://www.hashicorp.com/blog/build-your-summer-spotify-pla... I think the initial version took me a week?
- born-jre 4y agoAnything that can be built, someone will build it.
- faizshah 4y agoHow hard is it to code up a terraform provider if you haven't coded Go before? I have been considering swapping some python scripts over to terraform but I'm concerned about the time it will take to learn Go and Terraform. Anyone got some perspective on that?
- JoyrexJ9 4y agoIf you've never used Go, then writing a Terraform provider is a really bad way to start learning. Why do you think you need to write your own provider? Most people use the large ecosystem of prebuilt providers, and never write a single line of code
- imtemplain 4y ago
- tony_cannistra 4y agoLet us not forget the similarly-useful Dominos Pizza terraform provider: https://github.com/nat-henderson/terraform-provider-dominos https://github.com/nat-henderson/terraform-provider-dominos I could see one combining these into a nice evening.
- monatron 4y agoI once demo'ed Terraform to one of my old teams using the Dominos Pizza provider as an example. I ended up inadvertently ordering a Hawaiian style pizza to my house. It was....fine.
- tony_cannistra 4y agoIndeed -- per the docs [0]: > This is not a joke provider. Or, it kind of is a joke, but even though it's a joke it will still order you a pizza. You are going to get a pizza. You should be careful with this provider, if you don't want a pizza. [0]: https://github.com/nat-henderson/terraform-provider-dominos/blob/master/docs/index.md https://github.com/nat-henderson/terraform-provider-dominos/...