Closed sebaroesch closed 7 years ago
potentially, I already look up high res cover art against deezer public API, if that has search possibilities, it could work. Even better if it allows searching without authentication.
The apple music integration was contributed by another person however, I don't really have time right now to focus on music services. I gladly accept contributions though.
I'm the one that enhance the Apple Music functionality. It is very specific to Apple but the approach can be applied to other services. Does Deezer have a search api that is publicly accessible?
I can't get a look at the full api documentation because it wants a login. I'm in the US and it will not let me create an account. Looks like it is not yet available, but coming soon. I need to understand the search api and how it handles fuzzy searches for artists, tracks, and radio streaming. With the iTunes search, you can specify either an artist, track, or combination of the two and the search will find the best match. You don't have to tell it what you are going after specifically, which is key to how the appleMusic logic works. Not to say that something different can't be done with Deezer, just that it will not be quite as easy to use from something like Echo if you have to throw yet another word ("artist", "song", "combination", ...) into an already long search phrase. Outside of voice control, it probably doesn't really matter if the api needs separate uri's for each type of search.
Can you get me a copy of the search documentation?
I did a copy of the developer site, you can download it from here:
https://sprend.com/download.htm?C=b66ed6b0172b40d4a5a7e842962f8c3f
Thanks Jimmy. Looks like the Track and Radio searches will perform very similar to the two searches in appleMusic. It may even be possible to turn the appleMusic routine into something more generic that can work with Apple Music, Deezer, Spotify, etc.. Thoughts?
I suggest we evaluate that side-by-side when it is in place, but it's a good point.
I agree. I can't test Deezer until it is available in the US, but I can bang out Spotify.
Well into the Spotify effort and I'm actually going the combined route out of the gate to flush out the similarities and differences. I'm doing under a different name called musicSearch. At this point I can say that Deezer should be fairly easy to drop into the same solution, as well as any other service that has the same kind of search capabilities. Along the way I'm also making some general improvements and enhancements to the Apple capabilities.
One question that I have is that I now understand that different tracks may or may not be streamable in different countries. Is there a programmatic way to determine what the country code is for where the user is?
Not that I'm aware of right now. It might show somewhere in the /status pages, but another option would be to use some sort of initialization step to use a geo-ip service from maxmind.com or ipinfo.io. ipinfo.io is super-simple to use, just request that url and you will get a JSON object back with country info for your IP.
Just make sure and do the request once when the application is starting, since there is a throttling limit on it.
Where should the initialization code be placed? (server.js, sones-http-api.js, musicSearch.js?)
If not musicSearch.js, how can the country code variable be made global or how should it best be retrieved?
I suggest you create a js file that you require wherever you need the countrycode, which would get the countrycode and expose it as a variable only. Since node.js only execute files ones, and caches whatever you set module.exports
to, you can be sure that it only is invoked once per run. something like this:
country.js
// some code to get country code
module.exports = countryCode;
Then, const contryCode = require('country.js');
would give you the country code.
I now have both Apple Music and Spotify working. I believe that it will be easy to add Deezer and other services that have public search capability. I may be able to get it working now if someone can lend me an account and if it will work from the US.
I'm going to be traveling the next few weeks. I plan to put some finishing touches in place and submit it next month.
Great to hear. Looking forward to see the result, I can probably re-activate my deezer account and squeeze it in.
@jplourde5 Is it possible to add Sonos's built in music library integration? musicSearch of mp3 collections would be nice. I'm not a programmer, so I'm not sure if what you are doing for music service can be applied to the Sonos Music Library, but it would be nice.
I have an active Deezer account you can borrow.
@GregRocket Searching for local library is basically implemented but not exposed in the HTTP API, so it should be fairly trivial to add.
And I will be able to use fuse for a fuzzy search and add it to musicSearch like another service. Maybe call it "local".
[Infor]http://www.infor.com/
Jim Plourde | VP Cloud Services
mobile: 864.270.7677 | office: 864.546.5089 |jim.plourde@infor.commailto:jim.plourde@infor.com |http://www.infor.com
On Jun 23, 2016, at 3:21 PM, Jimmy Shimizu notifications@github.com<mailto:notifications@github.com> wrote:
@GregRockethttps://github.com/GregRocket Searching for local library is basically implemented but not exposed in the HTTP API, so it should be fairly trivial to add.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-227970145, or mute the threadhttps://github.com/notifications/unsubscribe/ASedkFGDAtLhr8eyB9nsT_Bvzvu6NOoEks5qOjQCgaJpZM4Iz0FU.
On Deezer, text me the password at +1-864-270-7677 and I'll give it a shot when I get back in a couple weeks.
@jplourde5 is your working branch available anywhere publicly yet?
Not yet. Out of pocket for a couple of weeks and will submit the Apple & Spotify version when I get back. I should be able to get Deezer added quickly if the test account works.
Just created a pull request for the new musicSearch action. Currently supports Apple Music and Spotify. Working on Deezer now.
Jplourde5,
Any chance of you doing the same to allow searching of the local Sonos library. I think someone else requested this as well. My local library at ca 120,000 tracks means that I really don’t have much use for streaming services. I have uploaded everything onto Amazon so that I can access it from Alexa – but alex doesn’t play though my Sonos & Russound system yet.
Many thanks for all the good work.
Peter
From: jplourde5 [mailto:notifications@github.com] Sent: Wednesday, July 06, 2016 11:24 To: jishi/node-sonos-http-api Subject: Re: [jishi/node-sonos-http-api] Deezer integration (#242)
Just created a pull request for the new musicSearch action. Currently supports Apple Music and Spotify. Working on Deezer now.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-230722087 , or mute the thread https://github.com/notifications/unsubscribe/AKyrHDA0wKbb6x31VksD986EHonmEhw1ks5qS3QcgaJpZM4Iz0FU . https://github.com/notifications/beacon/AKyrHLPOCJEc7Oml6wER7iPEYkBgFaG2ks5qS3QcgaJpZM4Iz0FU.gif
Just finished adding Deezer support. Now supports Apple Music, Spotify, and Deezer. I'll need some guidance from Jimmy on how to find and access a local Sonos library. I'll take a look at it if I can get some guidance.
Local browsing is "more or less" already implemented via the browse command. See this discussion for examples:
https://github.com/jishi/node-sonos-discovery/issues/7
This was for the old callback version, but it works similary with promises instead.
The problem with the library is going to be how to perform a fuzzy search. The browse function is not going to do that and loading 120,000+ artists+albums+songs into an array for the fuzzy search will probably take a while and exhaust the available memory. Without the fuzzy search, Alexa will have to nail what was said every time, which it won't, and I suspect that there will be many failed searches.
Thought about it some more and I'll give it a try. Peter (ppitkin), I'll need you to run some tests on your library. I have nowhere near 120,000 tracks. I gave up buying and ripping a long time ago. I'm a 99.9% streamer :) I'm headed out again tomorrow so it may be a week or so before I get to it.
Jimmy, I have the music library logic worked out but I have a question. Given that some of these music libraries can be quite large and may take some time to load, the library:
Given all of this, where is the best place to add the logic? sonos-http=api.js maybe?
If so, where in the code should the call be put to load the library?
Are you copying an index of the whole library for fuzzy search? I don't recall you doing that for other music services so why do that here?
Best place to put it would be during registration of a specific action, you can get any or all players and use them for fetching data. If it takes more than 30 seconds to index, it even makes sense to store the index on file for load on startup. On Jul 9, 2016 3:15 PM, "jplourde5" notifications@github.com wrote:
Jimmy, I have the music library logic worked out but I have a question. Given that some of these music libraries can be quite large and may take some time to load, the library:
- Should not be reloaded for every request
- Should only be loaded once unless a specific command is issued to reload it
- The initial load should happen when node-sones-http-api is being initialized, NOT when the first request comes in because that could cause a very long wait for the initial request
- The Player variable is required in order to retrieve the library
Given all of this, where is the best place to add the logic? sonos-http=api.js maybe?
If so, where in the code should the call be put to load the library?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-231533989, or mute the thread https://github.com/notifications/unsubscribe/ADBNI2SHmxFQ5TEd5xWPzYf2STLNwVblks5qT57mgaJpZM4Iz0FU .
The services perform their own fuzzy search so Fuse is not required. The browse function does not perform a fuzzy search so unfortunately the entire index must be loaded into any array for Fuse to work on.
[Infor]http://www.infor.com/
Jim Plourde | VP Cloud Services
mobile: 864.270.7677 | office: 864.546.5089 |jim.plourde@infor.commailto:jim.plourde@infor.com |http://www.infor.com
On Jul 9, 2016, at 1:40 PM, Jimmy Shimizu notifications@github.com<mailto:notifications@github.com> wrote:
Are you copying an index of the whole library for fuzzy search? I don't recall you doing that for other music services so why do that here?
Best place to put it would be during registration of a specific action, you can get any or all players and use them for fetching data. If it takes more than 30 seconds to index, it even makes sense to store the index on file for load on startup. On Jul 9, 2016 3:15 PM, "jplourde5" notifications@github.com<mailto:notifications@github.com> wrote:
Jimmy, I have the music library logic worked out but I have a question. Given that some of these music libraries can be quite large and may take some time to load, the library:
- Should not be reloaded for every request
- Should only be loaded once unless a specific command is issued to reload it
- The initial load should happen when node-sones-http-api is being initialized, NOT when the first request comes in because that could cause a very long wait for the initial request
- The Player variable is required in order to retrieve the library
Given all of this, where is the best place to add the logic? sonos-http=api.js maybe?
If so, where in the code should the call be put to load the library?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-231533989, or mute the thread https://github.com/notifications/unsubscribe/ADBNI2SHmxFQ5TEd5xWPzYf2STLNwVblks5qT57mgaJpZM4Iz0FU .
— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-231546249, or mute the threadhttps://github.com/notifications/unsubscribe/ASedkDlQqkLXwwq5DiPurbFQ3ggHo_5Uks5qT9z6gaJpZM4Iz0FU.
Is there a call made to each action during the registration, or would I put this in sonos.http.api.js?
The exported method (that calls api.registerAction()) is always called once during startup, anything that needs initialization can go in there.
I have the final version of musicSearch ready that includes the library search and play capability. It looks like the beta branch is closed though. How should I create a pull request?
Never mind. I hosed something up trying to create a fresh copy of the beta branch.
Just submitted a pull request for musicSearch which now supports Apple Music, Spotify, Deezer, and the local Sonos music library. Works great.
Thanks for creating that.
Do you happen to have updated your Alexa skill yet to make use of the library search?
Kind regards
Peter
From: jplourde5 [mailto:notifications@github.com] Sent: Saturday, July 16, 2016 3:42 To: jishi/node-sonos-http-api Cc: Peter; Comment Subject: Re: [jishi/node-sonos-http-api] Deezer integration (#242)
Just submitted a pull request for musicSearch which now supports Apple Music, Spotify, Deezer, and the local Sonos music library. Works great.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/jishi/node-sonos-http-api/issues/242#issuecomment-233101664 , or mute the thread https://github.com/notifications/unsubscribe-auth/AKyrHLQsMMCBBJk7MYqpNg5_IaM7SCK3ks5qWDbUgaJpZM4Iz0FU . https://github.com/notifications/beacon/AKyrHO7acY7wxnqBVDZWTPJrnN95K077ks5qWDbUgaJpZM4Iz0FU.gif
Working through some design options now with contributors over there. You can see the discussion in the "Default. Room" thread. I will be able to knock it out pretty quickly once a decision is made. We also need Jimmy to accept my pull request :)
Finished the echo-sonos work and will begin testing tonight. I'll provide links to my branches for others to test soon after.
This is in place with musicSearch
I am wondering if Deezer can be integrated in the same way as Apple music was added recently. Is this possible? And if so, is the Apple music integration a good starting point or would Deezer need to be handled differently?
Thanks for this awesome project and all the work you put in!