
Open-Source Spotify App - thasian
https://github.com/ThasianX/SpotifyDaily
======
bransonf
This is an iOS app, but if it isn’t what you were hoping for, check out these
other projects.

A CLI UI for Spotify [0] Spotify as a daemon [1]

[0] [https://github.com/Rigellute/spotify-
tui](https://github.com/Rigellute/spotify-tui)

[1]
[https://github.com/Spotifyd/spotifyd](https://github.com/Spotifyd/spotifyd)

~~~
alpb
Does anyone know why Spotify doesn’t pursue name rights or DMCA takedowns in
all these OSS projects, as they reverse engineer and use Spotify’s name?
Snapchat practices DMCA/copyright for a lot for these sort of projects.

~~~
dannyw
"Laws can definitely help, but it doesn't take away the problem. The only way
to solve the problem was to create a service that was better than piracy and
at the same time compensates the music industry – that gave us Spotify."

\- Daniel Ek (Spotify co-founder)

~~~
csunbird
I wish the TV industry can accept way of Spotify is the way to go. Instead,
now we have dozens of streaming platforms with exclusive contents.

~~~
sweeneyrod
They can't, because they have a different business model. For TV content
producers, consumers paying for content (with either dollars or eyeballs) is
their main source of income. But for musicians, most of their money comes from
playing live shows. So Spotify can be much more relaxed about revenue than
HBO.

~~~
pixelrevision
It also costs a good deal less for a band to put out an album than it does to
make a season of game of thrones.

~~~
selectodude
And an album provides far more recurring revenue than a movie does. I’ve
listened to my favorite albums hundreds of times. I’ve watched my favorite
television shows twice, three times at most.

------
1wheel
I'm working on a web player ripping off the winamp UI.

[https://roadtolarissa.com/winampify](https://roadtolarissa.com/winampify)

~~~
airstrike
Support for classic skins is what will make this a hit

~~~
rzzzt
On archive.org, you can choose webamp as an alternative audio player:
[https://webamp.org/](https://webamp.org/)

------
piracy1
This is cool. I've been wanting to modify Spotify to use the WhoSampled API to
auto-suggest, Amazon Prime X-ray style the songs a given song samples. Maybe
i'll do it now.

~~~
hemans
Can you ELI5 I'm interested in knowing more

~~~
cruano
Amazon Prime Video has an X-Ray feature that shows stuff like which actors are
in a scene you are watching. In a lot of music is very common for Artis to use
"samples", i.e. you take a small piece of a song and incorporate it into your
new song.

Who sampled lists every sample a song used. Take good life by Kanye West for
example [https://www.whosampled.com/Kanye-West/Good-
Life/](https://www.whosampled.com/Kanye-West/Good-Life/)

So I think what he means is using who sampled data and Spotify music to create
a player where you can click x-ray and it shows you the samples from that
segment of the song

------
verisimilitudes
My first thought, upon seeing this is licensed under the GPLv3, is that it
wouldn't be legal to run under iOS, as the Tivoization aspect would come into
play. However, as there is but one author, this issue doesn't materialize,
although the sole author is the only one who can legally submit this to run
under any machine, barring that private app exception I'm rather certain
someone would mention if I didn't first.

It's nice that you've chosen the GPL, as I also prefer that license, but what
value do you see in this software that only you can modify for use? Do you
intend to release an Android or other port, at some point?

~~~
djsumdog
Apple doesn't allow GPLv3 code if there are multiple contributors? I thought
they didn't allow GPLv3 code at all (and that this app required you to compile
and install it as as a developer .. never had an eyeProduct so I'm not even
sure what the dev process is like).

~~~
Wowfunhappy
If there's a single author, they own ultimate copyright to the code and can
submit it to the app store under a different license.

~~~
hsitz
Just to clarify for the developer, thasian, because you have all rights in the
code you can license it differently to different users. The version on github
will be gpl; you presumably could have different license for app store
purchasers. I think the ios port of Vim is done this way, it's github link is
[https://github.com/terrychou/iVim](https://github.com/terrychou/iVim) . Not
sure if that's actually the way terrychou did it, but surely you could ask him
about it.

------
haolez
It would be nice if their API provided endpoints for Spotify for Artists.
There is a lot of opportunity there to make apps that support musicians and
labels.

~~~
thasian
I think I get what you're saying: endpoints that artists can use that would be
beneficial towards their brand.

~~~
jedimastert
To clarify for OP, "Spotify for Artists" is the Spotify app that artists use
for analytics and the like.

------
mendelmaleh
Is this an actual Spotify app that streams music or can you just control music
playing on other devices/apps (like the cli UI's)?

~~~
thasian
None of the above. My app pulls in music using Spotify’s api. To stream music,
it redirects you to the Spotify app.

~~~
anamexis
What does “pull in” mean here?

~~~
thasian
Retrieves music from Spotify's database based on a set of parameters.

~~~
anamexis
As in, actual audio? Or metadata?

~~~
thasian
Pulls in metadata. I use the metadata's external url to open the track in
spotify.

~~~
newscracker
It would’ve been better if you had answered the question clearly at the first
instance. This thread seemed like playing 20 questions.

~~~
shhsshs
“To stream music, it redirects you to the Spotify app.”

Seemed pretty obvious to me.

~~~
akvadrako
He said it “pulls in music”. That’s seems obvious too.

~~~
Esthrowaway123
Yeah. That and "retrieves music" both sound like it's actually pulling encoded
audio files down

------
fao_
Tangentially related - I wrote a C library for spotify's web api:
[https://gitlab.com/finnoleary/spotifyc](https://gitlab.com/finnoleary/spotifyc)

I've been working on the cli client and shuffling things about directory wise
so I don't think it compiles anymore atm. But the library works fine. Actually
in retrospect I think I might revert and splt them into separate repos...

~~~
thasian
Must've been a lot of work. I considered writing a library for the Web API in
Swift, but there's just too much maintenance. There were also some weird bugs
I encountered when parsing JSON like the time stamps being in the wrong
format.

~~~
fao_
Yeah. I just leave the json parsing up to the caller partly as a
simplification, but also because I might accidentally discard data they want
(Like, ideally that should never happen but our world is not ideal). The only
thing it wraps is the authentication (to make life easier), and the web
request. The C code is generated from a small python script that's generated
directly from the documentation so it's relatively easy to keep up-to-date,
the sacrifice is it is a bit more fragile than I like.

------
haecceity
I have a question for those familiar with Spotify API. Do they serve you the
song's audio bits and if they do how do they do DRM?

~~~
snissn
Hi! I haven't used the Spotify API, so this is just a guess. The demo app has
a "Sign in with Spotify" component of their authentication so my guess is that
you make an API request to Spotify for a specfic song and Spotify sends back
to you a cryptographically signed URL that expires after a reasonable amount
of time that lets you access the entire song in MP3 form and contingent on
using their API you only use it transiently to play to this specific user.

~~~
bransonf
I don’t think this is how it works. I haven’t played with the API but I’ve dug
around a bit in the source for the Spotify client.

More likely, it’s by sending a stream of data or otherwise its sending
encrypted chunks for which Spotify has a decoder integrated. That’s how the
desktop client works at least.

Your prediction seems unlikely to me for the reason that any transmission of
unencrypted data like that exposes Spotify to having their whole library
scraped.

Not that it’s technically impossible already, but I would say incredibly
infeasible.

~~~
Macha
The old API (libspotify) did decrypt raw audio data and hand it to the player.
This is likely why it was killed (that and an inability to tie usage to apps,
only to users).

The currently supported SDKs are for web, iOS and Android which perform the
decryption via EME or platform specific DRM support. They also require app
specific oauth authentication.

However, libspotify's playback endpoints still work, likely due to them still
supporting older hardware devices (other endpoints, most notably search are
now broken). This is ultimately what most open source native clients use,
either using archived builds of libspotify (for e.g. Clementine or mopidy) or
reimplentations of it (librespot, Spotifyd).

Because the new API is so locked down it's likely that open source apps won't
ever migrate to it (without the raw audio data they can't integrate it with
most of their features), and will have to drop support when the last endpoints
supporting libspotify style playback are pulled.

~~~
kingosticks
Mopidy does indeed still use libspotify through our pyspotify Python 3
bindings. Search and everything relating to playlists is broken in
libspotify[0] so we use the Web API for this functionality in Mopidy 3 (just
released). Spotify's newer browser-only streaming library is useless to us.

I believe that librespot (at least one of the implementations) now supports
audio from Spotify's new HTTP endpoints, rather than via the 'Mercury'
protobuf stuff that libspotify uses. The point being that it might still have
a future after Spotify finally kills the remaining parts of libspotify.

Disclaimer: I'm a Mopidy developer.

[0] [https://jodal.no/2016/02/18/guide-to-poor-api-
management/](https://jodal.no/2016/02/18/guide-to-poor-api-management/)

Edit: oh, and you do need an API key to use libspotify, which Spotify no
longer provide. So that kills off any new users from adopting
libspotify/pyspotify, even if they could live with the short-commings.

------
bilekas
Interesting..

> 'and provides users with important metrics like their top tracks, top
> artists, and recently played tracks, queryable by time range'

Is your feature selling point the time range ? I'm confused.. Looks like
spotify has this already...

EDIT: I get it now: Change the title to : Manage your own Spotify

Any extra functionality ?

~~~
thasian
Never really considered that but I guess the selling point would be the fact
that users get notified when their favorite artists release new songs. My app
is one of many that does song pulling but it uses the Spotify api, one means
to an end. The community can add extra features: all I’ve created is something
that’s possible with the Spotify api that others can branch off of

~~~
setr
I'm pretty sure he only meant selling point as a "why should I care about your
repo" or "what purpose is this program trying to fulfill" statement: not
actually suggesting to selling as a product

~~~
thasian
Right. Once again, never really thought of that. It could be a useful tool for
others to learn off of: the app employs a MVVM and Coordinator architecture
with reactive bindings. It's also a good example of using the Spotify Web API
for Swift since there aren't many examples out there.

~~~
bilekas
' It's also a good example of using the Spotify Web API for Swift since there
aren't many examples out there'

There is never any harm to educate others; I'm not so strong on Swift at all,
but I really appreciate the area that I dig into too. This project, is well
worthy of a follow.

------
nsomaru
OT: does anyone know why an existing playlist would suddenly become something
comepletwly different?

I used to listen to a Carnatic Classical playlist (Here’s a playlist for you…
Carnatic Classical by Spotify
[https://open.spotify.com/playlist/37i9dQZF1DWZqTcNLmb3sH?si=...](https://open.spotify.com/playlist/37i9dQZF1DWZqTcNLmb3sH?si=mBRrBkjiS2KjOEMEyn6e8g))
and now it’s just changed to something completely different. Honestly this
made me want to leave!

~~~
tastroder
I don't think playlists are market specific so I'd guess that was either just
human error or some automated script on Spotify's part going wrong. Google
cache confirms that the same playlist ID was used for the one you are looking
for.

------
dickeytk
Someone should rebuild turntable.fm using Spotify

~~~
jason_zig
Yeah I did this in my own way - it’s not an exact clone but it’s heavily
inspired by ttfm. I built [https://www.jqbx.fm](https://www.jqbx.fm) check it
out - would love your feedback :)

~~~
dickeytk
It’s awesome. Definitely going to be using this a lot once the break is over.
Thank you!

------
meddy
It seems like they've used RXswift for making this app. Honestly, Reactive
Programming still looks like magic for me, is it worth it to abandon the old-
school MVC and start learning that concept? Why should I start my new projects
with RX?

------
bilekas
Is this all you ? Or you have some friends with you ?

It's really nice for 1 person.

~~~
thasian
Only me

~~~
bilekas
I guess, it's a lot of time, but do _you_ use it? Is that why you made it ?

I'd love to send 100 questions on.

~~~
thasian
That was one of my intentions. I also started this project to learn more about
reactive programming and exploring the technical sides of creating views in
Swift.

~~~
bilekas
Swift I'm not familiar with Swift personally, but given what you've laid out;
it's language agnostic.

You've committed a lot time to it.. A lot of us have ideas of somthing
simular, but we get busy... This is the time to cut and run.

Are you currently employeyed ? (no need to give who).

How much time did you commit to this, kinda cool piece that is expected a lot
of time!

As I said before, I have 100 questions!

Full disclosure: I'm a cpp heart with a current role in cs

~~~
thasian
I think this conversation would best be continued by email, which is in my
bio.

To answer your questions, I will be interning at a company starting January. I
worked on this project for less than a month. Since I'm a 1st year in college,
I also have my studies but I try to code at least 2 hours a day.

------
maayank
Tangentially related, does the Linux spotify app provides any additional
features to the web-based client?

------
d--b
Why isn’t Spotified concerned about people making apps that rip their content?

Is audio piracy not a thing anymore?

~~~
jaysh
Spotify are not enabling audio piracy by much because they don't provide an
audio stream for songs via their API (beyond a short sample).

------
alpb
@dang Maybe add Show HN: prefix?

~~~
grzm
Fastest and most reliable way to contact them is via the Contact link in the
footer.

------
saagarjha
Interesting, I didn't know Spotify had an API to play music on iOS…

~~~
sod
Every spotify app can act as a remote control if spotify already plays on
another device. E.g. if spotify plays music on a PC, then you select another
song in the smartphone app, it will actually change the playback on the PC. I
guess the api allows to tap into that.

------
cumwolf
looks like you're using the web api instead of the IOS sdk? any reason for
that? is the ios sdk not in swift yet ? It was a pain to setup the last time i
looked at it.

~~~
thasian
The documentation for the iOS Sdk is terrible. It's also in Obj-c. The Web API
is pretty clear and we all love JSON. The only thing I could see myself using
the iOS Sdk for is remote playing.

------
hemans
Could you ELI5 I'm interested in trying this out.

Thanks

