Use API
This commit is contained in:
parent
23541ae239
commit
79a62b5e2f
4 changed files with 30 additions and 20 deletions
|
@ -779,26 +779,20 @@ const app = new Vue({
|
|||
|
||||
document.addEventListener('musickitloaded', function () {
|
||||
// MusicKit global is now defined
|
||||
fetch("https://beta.music.apple.com/", {mode: "no-cors"})
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
var el = document.createElement("html");
|
||||
el.innerHTML = data;
|
||||
var u = el.querySelector(`[name="desktop-music-app/config/environment"]`)
|
||||
var amwebCFG = JSON.parse(decodeURIComponent(u.getAttribute("content")));
|
||||
console.log(amwebCFG.MEDIA_API.token)
|
||||
MusicKit.configure({
|
||||
developerToken: amwebCFG.MEDIA_API.token,
|
||||
app: {
|
||||
name: 'My Cool Web App',
|
||||
build: '1978.4.1'
|
||||
}
|
||||
});
|
||||
setTimeout(() => {
|
||||
app.init()
|
||||
}, 1000)
|
||||
console.log("Loading musickit")
|
||||
ipcRenderer.on('devkey', (event, key) => {
|
||||
console.log(key);
|
||||
MusicKit.configure({
|
||||
developerToken: key,
|
||||
app: {
|
||||
name: 'My Cool Web App',
|
||||
build: '1978.4.1'
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
app.init()
|
||||
}, 1000)
|
||||
})
|
||||
});
|
||||
|
||||
function xmlToJson(xml) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue