Luke’s Status Report for 2/17/24

This week, I focused a bit more on the Spotify web player and authorization protocol rather than the ML model. The architecture of our server interactions with Spotify were more complex than initially expected so I had to come up with unique solutions that would work on a RasPi. The resulting solution was as followings: launching a NanoHTTPD server to send and receive requests, and then using Selenium WebDriver to authorize with the Spotify authentication endpoint. The tricky part here is that typically with Spotify web apps, there will be multiple users logging into your app with their own Spotify credentials via a web browser. But, we want to house this infrastructure in a Pi, with no graphic interface for the login credentials, since we will only be using a single Spotify account for the system. Thus, I needed to use web driver to automatically interact with the redirect URI that Spotify responds to an auth request with. This involves entering credentials, logging in, and then grabbing the session params after the successful login to retrieve the Authorization code that will be used to make future Spotify API requests that need user scoping. Below you can see this in action as we start the app:

Then, a Chrome WebDriver instance is launched, directed to the Spotify login page.

The credentials are then automatically entered. For this example, I am using my account but in the future we will have a premium account solely for the Music Mirror system.

And finally, the driver is automatically closed once the authorization code has been received.

In addition to this, I worked on more solution approach work to prepare for this week’s presentation

We are mostly on schedule, but I am a bit behind on the ML module development as this authorization solution took longer than expected to devise. However, we are on track in all other areas and should be making great progress next week.

Speaking of, I plan to now use this working auth infra to build the ML rec model wrapper that will communicate with our user’s input and the Spotify API to create song recs to add to the system queue. I also plan to solidify any other solution design decisions in terms of the ML modules for the system.

Leave a Reply

Your email address will not be published. Required fields are marked *