Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spotify as Music Player #216

Open
eliasbnr opened this issue Jan 18, 2021 · 6 comments
Open

Spotify as Music Player #216

eliasbnr opened this issue Jan 18, 2021 · 6 comments

Comments

@eliasbnr
Copy link
Contributor

Hey,
is it posible to play the music from spotify instead of youtube?
Best regards
Elias B.

@robinfriedli
Copy link
Owner

You can search tracks, albums and playlists on Spotify and enter open.spotify URLs or Spotify URIs if that's what you mean. But in reality it is impossible for third party applications to stream tracks from Spotify directly since they use encrypted media extensions, which is why Spotify tracks and looked up and played from YouTube instead. See also #137

@JoshuaDoes
Copy link

It's entirely possible as long as you know what you're looking for to be able to interact with Spotify, I have Spotify's raw 320Kbps OGG streams in my Discord bot Clinet :P

@robinfriedli
Copy link
Owner

Care to elaborate on that at all or are you just here for self advertisement? The only way to even receive and play Spotify audio for a third party client is using the Web Playback SDK. Since the SDK is not supposed to allow downloading / redistributing the audio I presume you're abusing it somehow. I don't think this is a good and scalable solution for a public bot in 60k + guilds and with 300+ concurrent streams because the SDK can't play several tracks at once and requires Spotify Premium, unless you've found a way around that too. Either way you're at the mercy of Spotify fixing their SDK or potentially even suing you if that's what you're doing.

@JoshuaDoes
Copy link

JoshuaDoes commented Feb 14, 2021

Oh for sure, there's the issue of the legality behind it but it's no less severe than Google with streaming the audio of YouTube videos, which I'd argue is a larger risk personally. You're looking for librespot with one or more Spotify Premium accounts for scale, and of course you're at the mercy of the API developers but I've had successful Spotify support for almost two years now with a tested high of 15 concurrent streams through a single Spotify account. As for my bot's legality, I'm just loopholing it with a custom intermediary private service that can be taken offline without risking my own bot, as none of the terms-infringing code nor account details are public.

@robinfriedli
Copy link
Owner

Well I'm certainly no lawyer but as far as I know when it comes to YouTube videos, YouTube does not legally own the videos they serve on the platform but the uploader. So to my understanding, while they certainly can lock you out of their platform for TOS violations I'm not sure if they can take legal actions without a YT content creator pressing charges. In the case of Spotify you're distributing their licensed content. And being a paid service they probably have more interest in actually enforcing that. Though realistically they'd probably send a cease and desist before pressing charges. Again I'm certainly no expert on this but I would say Spotify is riskier. Either way, librespot is certainly good to know, thanks.

@JoshuaDoes
Copy link

You're right, the licensing of the raw audio files is a little riskier, but where I say it matches up is that it's the same licensed songs being streamed through the bot in the end regardless of source. So if you're ever interested in giving it a go, I'm offering to help with setting it up (and I'm also open-sourcing a conglomerate music service player once I'm done with it that supports Spotify and Tidal too, so I have working sample code as well should you need reference since it's gonna replace my music service handler).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants