[HN Gopher] Spotifyd
___________________________________________________________________
Spotifyd
Author : fahrradflucht
Score : 260 points
Date : 2022-12-19 18:56 UTC (4 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| jamespullar wrote:
| Original discussion:
| https://news.ycombinator.com/item?id=16603886
| jonas-w wrote:
| What i find the most interesting is the zeroconf option [0].
|
| For example you can set up your spotifyd daemon on a raspberry
| and have it always connected to speakers.
|
| Now when someone is in your local network they can choose your
| spotifyd daemon and play spotify over the speakers without
| connecting to the speakers directly via bluetooth etc.
|
| [0] https://spotifyd.github.io/spotifyd/config/File.html (after
| the configuration file example)
| jegp wrote:
| Exactly. And it gets even better if you pair it with a personal
| voice assistant, like mycroft.ai
|
| "Hey Mycroft, play songs about better software integrations"
| kristo wrote:
| I have this. It's great except it randomly fails and
| disconnects or refuses to play. Have tried many updates for
| multiple years and always the same. I resorted to airplay.
| Spotify doesn't want to integrate with others and so the
| reverse engineered api doesn't work great
| bentt wrote:
| I thought this died with Spotify's nerfing/killing of API access.
| I had a project going with Mopidy which relied on it that I just
| dusted off the other night after a year and it wouldn't
| authenticate. Kept saying "requires Premium account" despite my
| account being Premium.
| dropofwill wrote:
| This uses librespot, not the original library that Spotify
| published and recently killed. Mopidy is also moving to
| librespot, but it's complicated with their gstreamer
| architecture (though I believe its mostly functional at this
| point).
| slenk wrote:
| Can't wait for mopidy to switch over - I have "Pirate Audio"
| PI hats that work are based around mopidy and I am not clever
| enough to figure out how to use the LCD screen with others.
| MrGilbert wrote:
| I'm kind of amazed that this is still working. I would have
| thought that Spotify is rather strict with their eco system.
|
| I was always interested in their techstack, and how everything
| works on their end, but unfortunately I'm not into Java, which is
| the reason I never applied for a job there.
| svnpenn wrote:
| > I'm kind of amazed that this is still working.
|
| this is why:
|
| > Spotifyd requires a Spotify Premium account
|
| which is actually not true. you can change some code in the
| source, to allow playback on free accounts. Spotify hunts down
| anyone who posts code like that though
| encryptluks2 wrote:
| I had no idea that was possible. Will be Googling for this
| later today. Thanks Google!
| disintegore wrote:
| Isn't there a better way to do this? Rate limiting, splicing
| ads into the audio signal for non-paying users, providing a
| stable API for paying users only, etc. Beats siccing your
| lawyers on hapless geeks.
| bmicraft wrote:
| Spotify has a stable api for free users too (as can be seen
| by devices sold with that capability, it just isn't
| public). Splicing and rate limiting would clash with
| caching I would imagine
| trasz3 wrote:
| kitsunesoba wrote:
| I'm glad this exists, but it's unfortunate that the reverse-
| engineered librespot that this depends on is necessary, thanks to
| Spotify backpedaling on their promises of a streaming-capable
| replacement for libspotify.
| acidburnNSA wrote:
| After spotify forbade the last library that could do this, I
| took spotify out of my mopidy/snapcast whole-house audio
| system, cancelled my premium subscription, and have spent the
| same money buying albums in MP3 from Amazon ever since. So far
| so good.
| bobleeswagger wrote:
| You guys still don't own your music?
|
| _Laughs in Lidarr_
| KMnO4 wrote:
| Sounds like you don't _own_ your music either.
| ubercow13 wrote:
| Neither in some sense do people who own physical media, eg.
| a CD.
| muppetman wrote:
| This is why I bought 5-6 Chromecast audio devices before they got
| nuked - they do exactly this (and other streaming services).
|
| Yea it's tied somewhat to Google, but it's a simple easy to
| deploy puck that just works.
|
| Not to suggest the hard work that's gone into this isn't awesome,
| because it is!
| [deleted]
| Daunk wrote:
| Has anyone ever gotten this to work?
|
| I must have tried it a dozen times by now, but never once gotten
| it to work.
| dcminter wrote:
| Yep, I have it running on a couple of Raspberry Pi and it works
| well. I hacked up one librespot on one of them to spit out
| track names in the event hooks so I could show them on an eink
| display hat!
| top_post wrote:
| I was in the same boat - I can't remember the exact issue now -
| but I had to both compile locally and revert back to an older
| version for it to work. There were issues on Github relating to
| my exact problem but I can't find them now. Currently running
| 0.3.3 as my daily driver, no issues.
| vehemenz wrote:
| Yep. I just installed it on macOS via Homebrew. Took about 5
| minutes to get set up.
| nzoschke wrote:
| Always great to see new ways to integrate with Spotify. I think
| that if you're paying for a Spotify Premium subscription you
| should be able to stream music wherever you want!
|
| However Spotify doesn't agree. If this is based on librespot its
| using stuff Spotify doesn't support and could easily shut down
| for unauthorized clients any time.
|
| Their supported paths are iOS and Android SDKs for mobile, and
| the Web Playback SDK for desktop [1]. I've been using the web SDK
| in anger to build a jukebox app [2] and its only so-so.
|
| First, you're under the confines of a web browser which has some
| pretty big tradeoffs over the experience and system integrations
| you can build.
|
| Next, song playback works as advertised but there are many things
| you can't do like introspect the queue or prevent Spotify Radio
| from kicking in.
|
| The latter is downright hostile to controlling exactly what songs
| you hear. I assume that always going into auto-recommendation
| mode is intentional to juice playback stats.
|
| Kudos to spotifyd for offering total control over how and where
| you stream music you're paying for.
|
| 1. https://developer.spotify.com/documentation/web-playback-
| sdk...
|
| 2. https://www.getjukelab.com/
| dahdum wrote:
| > I assume that always going into auto-recommendation mode is
| intentional to juice playback stats.
|
| That's one of my favorite features, sometimes I'm too
| distracted driving or doing something else to manage Spotify,
| but that doesn't mean I want the background music to stop
| entirely.
| nzoschke wrote:
| Yes it's a killer platform and Spotify app feature.
|
| But for a developer building a custom listening experience it
| needs to be completely optional.
|
| Right now you literally can't build an experience that plays
| just one song and stops after because "radio" automatically
| kicks in. You need to do crazy hacks to pause the current
| song before it ends or enqueue a silent track and intercept
| that, if you don't want to occasionally hear a small bit of
| an unwanted radio song before correcting.
| EMIRELADERO wrote:
| Is your web app open source?
|
| Maybe this is just me, but I take an issue with projects that
| use GitHub's community features but don't publish their source
| code. Feels somewhat unfair.
| nzoschke wrote:
| Currently not open source but I long have been thinking about
| open sourcing it.
|
| What's wrong with using GH community features?
|
| It's a side / passion project so no time or budget to build
| any support or community stuff. I considered GitHub, Reddit
| and Discord and all have pros/cons.
| nomel wrote:
| > However Spotify doesn't agree.
|
| My naive assumption is that Spotify would love to, but the
| record labels don't agree.
| nzoschke wrote:
| Could be.
|
| When Spotify was young they were extremely developer and
| ecosystem friendly. It gets progressively worse and worse
| over time.
|
| The biggest change I personally suffered from is when they
| pulled out of their integration with Djay, a DJ app. This
| integration was amazing for bedroom DJs like myself, being
| able to use Spotify to organize DJ music and DJ directly from
| it. Then they sunset the entire integration.
|
| Now Djay and even bigger apps like Pioneer Rekordbox
| integrate with Tidal... Do the labels prefer Tidal over
| Spotify for some reason? Or did Spotify decide to get out of
| this game for reasons of their own?
| SleekoNiko wrote:
| > When Spotify was young they were extremely developer and
| ecosystem friendly. It gets progressively worse and worse
| over time.
|
| This is somewhat tangential, but I feel like this happens
| often, as internal power and culture shifts away from being
| developer-driven to consumer- or manager-driven.
|
| This doesn't happen for every company, thankfully.
| elefanten wrote:
| Seems quite related to the standard 'company lifecycle'
|
| And, to your point, not every company follows one. But
| most do.
| conductr wrote:
| The average user at scale is nothing like the average
| early adopter user. Developers tend to be early adopters
| of tech products.
| super256 wrote:
| > Do the labels prefer Tidal over Spotify for some reason?
| Or did Spotify decide to get out of this game for reasons
| of their own?
|
| Me, being a naive speculator: Maybe it has something to do
| with the time. The original contracts between spotify +
| labels were probably written 15 years ago. Over time they
| might have changed numbers like how big spotify's cut is,
| but never revised the rest of the blueprint contracts.
|
| So, my bet is laziness / not caring enough.
| rrrrrrrrrrrryan wrote:
| Tidal was basically a music streaming platform made by the
| music industry itself to have some leverage in negotiations
| with Spotify / Alphabet / Apple / Amazon.
|
| It's since evolved into something else, but it's not
| surprising that Tidal can get some unique deals due to its
| close industry ties.
| humanistbot wrote:
| > Do the labels prefer Tidal over Spotify for some reason?
| Or did Spotify decide to get out of this game for reasons
| of their own?
|
| Yes, labels and artists get a bigger cut of the
| subscription cost from Tidal. And before the buy-out by
| Square last year, Tidal's parent company was majority-owned
| by Jay-Z and had lots of buy-in from music industry
| insiders.
| eloop wrote:
| Question - do any of the other streaming services have better
| Linux support?
| jez wrote:
| In the past, another tool I've used is this bash script that
| interacts with Spotify over dbus:
|
| https://gist.github.com/wandernauta/6800547
|
| It's nowhere near a fully featured Spotify client, but for little
| scripts or UI things where I just want to see the current song
| it's pretty lightweight and already works with the Spotify app I
| have installed (obviously this means it has a different end goal
| in mind than Spotifyd).
| suprjami wrote:
| Have tried this several times but I find it drops off the network
| as a remote play device.
|
| If you have a PC with the Spotify app running, that appears as a
| remote play device to other clients.
|
| Otherwise I found ncspot to be more reliable than spotifyd:
| https://github.com/hrkfdn/ncspot/
| bmicraft wrote:
| I've used it for over a year but never that issue. Works
| perfect for me
| jrm4 wrote:
| Honestly -- just _why_?
|
| We now have a few years of experience with music streaming. And
| what we've learned is that -- sure, it's convenient -- but
| honestly hasn't much improved the lot of artists and musicians.
| It's a new exploitative system that's perhaps slightly better
| than the old exploitative system.
|
| We can do better. Literally, locally, and for friends. I used to
| do MPD, but now I'm glad for things like mstream that make this
| sort of thing even easier. I hope funkwhale and other federated
| things do better as well.
| dtx1 wrote:
| Meh, I always pirated music before Spotify. Then I got a free
| test account and now am a happy paying customer for forever. As
| soon as someone with a reasonably similar library and better
| linux integration than a half abandoned electron app comes
| along i'll switch.If Artists feel so bad about they should form
| a union and collectively bargain for a better position.
| iamacyborg wrote:
| > If Artists feel so bad about they should form a union and
| collectively bargain for a better position
|
| They can't, major record labels and major artists are working
| with Spotify to fuck everyone else.
| Bluecobra wrote:
| I'm sure someone will find a use case for this. For example, a
| long time ago I hooked up a Raspberry pi to my receiver/speaker
| system and used mplayer to keep a persistent connection to a
| remote Internet radio stream. Whenever I wanted to listen to
| it, all I need to do was turn on my receiver and select that
| audio interface.
| civopsec wrote:
| Why are people using a streaming service instead of buying
| thousands of dollars worth of CDs (or for that matter, iTunes)?
| Is this a question?
| jrm4 wrote:
| This has never been the dichotomy; but now that you mention
| it -- actually, yeah. I'd rather spend thousands of dollars
| on CDs (in that environment where shopping for them was like
| it used to be) than iTunes (etc., which I've tried but never
| found worth continually paying for)
| rblatz wrote:
| There are still music stores, nothing is stopping you from
| buying music like we did before Napster let the cat out of
| the bag. People are allowed to have different utility
| functions and preferences, sorry yours seems to be going
| out of fashion.
| richwater wrote:
| > but honestly hasn't much improved the lot of artists and
| musicians
|
| As a consumer of music, why is this my problem?
| fullshark wrote:
| Potentially great music is not being made as a result of
| people not devoting time and energy to the craft I guess.
| Also just general empathy.
| civopsec wrote:
| You _guess_?
|
| Music is like the last thing that will stop being made
| because people can't professionalize their craft.
| fullshark wrote:
| You don't think it has any impact? Even on the margins? I
| think it's basically expected that musicians will give up
| some day and join the working world, in part because it's
| so hard to make a living in. If it's harder to make a
| living -> more people give up -> less music. If it's
| easier -> fewer people give up -> more music.
| civopsec wrote:
| It's not a question of whether it has no impact or not
| because that's irrelevant. You would actively have to
| _punish people_ for making music in order for music not
| to be made--that's how strong that force is. (Well heck,
| maybe _more_ music would be made in that case, out of
| spite and rebellion.)
| iamacyborg wrote:
| This is a rhetorical question, right?
|
| If you consume music then surely, you want the artists and
| musicians you support to be paid fairly for their work.
| civopsec wrote:
| Why is that "surely"?
| iamacyborg wrote:
| You're right, my bad, I assumed most folks would have a
| base level of empathy.
| smolyeet wrote:
| Well , it's either I listen to it using this easy
| platform for us common folk, or I don't listen to them at
| all. Or i pirate. It's not that deep , you can get off
| your high horse.
| meltedcapacitor wrote:
| Between dead artists and art-for-art-sake artists we're not
| gonna run out of stuff to listen to, even if intellectual
| property was abolished tomorrow morning (as it should be).
| It only works for the 1 percent at the top anyway (due to
| power law distribution).
| strken wrote:
| Can you or jrm4 explain why Spotify's royalty system (a
| 70/30 split in favour of the rights holder) is unfair?
|
| If I had to guess I'd say it convinces artists to license
| their work for less money than they'd make if they stuck it
| on Bandcamp, but I'm not certain, and neither of you has
| explained it.
| nyx_land wrote:
| The fact that this is receiving downboats and 'but muh
| convenience, artists deserve to get fucked over because Spotify
| found a better way to exploit human psychology!' is truly an
| orange site moment. I pirate the majority of the music I listen
| to (and most artists except for super rich mainstream ones
| would rather their music spread as much as possible than
| receive literal pennies from a Spotify stream) and buy stuff
| from Bandcamp when an artist is actually still around and
| making stuff. I never listen to ads and have all the files
| saved locally in lossless formats. I've never had a Spotify
| account for anything other than a podcast that is exclusive to
| it and have never cared to switch, and can't even use the
| excuse that I'm too old and stubborn in my ways.
| civopsec wrote:
| Exploit human psychology?
| 14u2c wrote:
| Some impressive cognitive dissonance here.
| hedora wrote:
| I've happily moved on from Spotify.
|
| Has anyone produced similar (and working) alternatives for Tidal
| (or Sonos S1/S2)?
| SparkyMcUnicorn wrote:
| I used this at one point. Might give you what you're looking
| for.
|
| https://github.com/tehkillerbee/mopidy-tidal
| musicstealer wrote:
| This uses librespot for the actual communication with Spotify's
| servers.
|
| Note that to get it to support Spotify Free, you need to compile
| a custom librespot with this part of the code commented out, that
| checks for Spotify Premium: https://github.com/librespot-
| org/librespot/blob/6dc7a11b09b5...
|
| And then use this with spotifyd instead of the original.
| Kuraj wrote:
| Haha I always thought it was Spotify who enforced this
| requirement on their end
| sbarre wrote:
| I mean, it kind of is..
|
| I think there's an unofficial understanding that if someone
| puts out a way to access Spotify Free that removes or
| bypasses the limitations and constraints that Spotify imposes
| on free accounts, they would summon the lawyers.
| timetraveller26 wrote:
| But please don't, otherwise you may get the lib killed for
| everybody.
___________________________________________________________________
(page generated 2022-12-19 23:00 UTC)