Jump to content

Spotify Remote Controller beta


vx89

Recommended Posts

Small update (updated the link in the first post as well). I added support to get periodical updates what's currently playing.

Here is example of the newly added spotify_notifier always showing currently playing track in bottom right corner.

108ajap.jpg

Link to comment
1 hour ago, Fabioxps said:

I can connect more I get errors like 404 play music does not work 

help me this is fantastic

Hi. Not sure what you are saying, so I'm trying to cover the case where it does *not* connect.

1. Go to https://open.spotify.com/embed?uri=spotify:user:spotify:playlist:3rgsDhGHZxZ9sB9DQWQfuf and see if controlling Spotify from there works.

2. When Spotify is running, go to start menu and open "Resource Monitor".

In Resource Monitor choose "Network" tab.

In "Listening Ports" section order the table by "Port" column and look if Spotify.exe is running in range 4370-4381. Also if there is anything else running in that range. Let me know.

3. Let's try next steps when we cover the previous ones..

Edited by vx89
Link to comment
30 minutes ago, Fabioxps said:

In spotify_api/api.lua change connect(4380) to connect(4381).

Looks like when SpotifyWebHelper.exe is running it occupies 4380, so our port scanning finds that 4380 is responding to our status request. However running any actual commands will fail with that 404 error. I will add status command check to make sure the found port is OK.

Edited by vx89
Link to comment
20 minutes ago, Fabioxps said:

it works

Is it possible to find musics?

Not through this API. You might find the music some other way (e.g to find first 200 songs of a specific playlist or album one could parse https://open.spotify.com/embed?uri=spotify:user:spotify:playlist:3rgsDhGHZxZ9sB9DQWQfuf)  (this is exactly what I will add actually) and use spotify_api just for playback .

 

Spotify also provides Web API, but it requires user authentication, where user is logged in to spotify.com and your service would prompt spotify.com to ask for a request token to your service for a given user, with user permission. But this can securely happen only inside user web browser. Definitely not MTA, because you have to be logged into spotify.com and there's no safe way to do that inside MTA.

Another way to use Web API is that you authenticate only yourself and searching for songs (with your API key) is always done on server side and just the result is passed on to client-side.

There might be some 3rd party services providing spotify search though.

Edited by vx89
Link to comment
20 hours ago, Fabioxps said:

How do you find a certain album? example: "Justin Bieber"

https://open.spotify.com/embed?uri=spotify:user:spotify:playlist:  "Justin Bieber"

 

Unfortunately searching for Justin Bieber is banned on that website.

On more serious note though, that specific website allows only specific spotify uri ids, so no search by names. Only useful part of that website is to get content of specific playlist id; specific album id or specific artist id.

After thinking about it, I think it's actually relatively safe to create a new Spotify account, ask for Spotify Web API token from it, which has no user-specific rights, so you could make that token public (i.e use it directly on client-side) and use Spotify Web API with that token to search for songs. If you will actually try to do it, let me know if that kind of web api user token needs refreshing or it's permanent or if there are any other issues I was not thinking about.

Edited by vx89
Link to comment
  • 1 month later...
  • 8 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...