Open mariusor opened 6 years ago
OK, so I managed to solve the first two questions.
The only problem is to extract a valid Authorization: Bearer XXX
header from the other requests. Does anyone have any advice?
Update.
I have a working version of the Spotify plugin which loads the data from the API, but the only missing part is the Authorization header which needs to be intercepted from the other requests.
Since there isn't any way to intercept them at DOM level, I was thinking that maybe it's possible to use QWebEngineUrlRequestInterceptor from the Qt code to extract this header and then make it available it in the spotify plugin script.
@CDuquesnoy is this a feasable option? (I'm asking because my Qt is very rusty, and the new QWebView APIs are completely foreign to me)
Everything is possible, but I don't like the idea to add c++ code specifically for a plugin. I'd prefer if plugin specific code would remain in the plugin itself.
I've never done that but wouldn't it be possible to simply redefine the prototype of HttpRequest.open? This blog post might help you get started: https://dmitripavlutin.com/catch-the-xmlhttp-request-in-plain-javascript/
This issue has been moved to our new gitlab issue tracker.
The github repository will be archived soon and this issue will become read-only. We suggest you continue the discussion and follow the progress on this issue at gitlab.
Description:
A followup to #272.
Unfortunately I haven't found any simple way of extracting the album information from the player web-page.
Is it possible to reuse the web-player authenticated session to actually execute an API request?
For example the hyperlink of the anchor representing the title of the song contains the album id. Which we could use to execute an API request1
GET https://api.spotify.com/v1/albums/{id}
Basically my questions are:
Additional Information:
[1] https://developer.spotify.com/documentation/web-api/reference/albums/get-album/