i dont wanna pay 100 bucks apple
This commit is contained in:
parent
64444b2123
commit
fc86783b5f
1 changed files with 19 additions and 9 deletions
|
@ -74,8 +74,16 @@ const app = new Vue({
|
|||
|
||||
document.addEventListener('musickitloaded', function() {
|
||||
// MusicKit global is now defined
|
||||
fetch("https://beta.music.apple.com/")
|
||||
.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: '',
|
||||
developerToken: amwebCFG.MEDIA_API.token,
|
||||
app: {
|
||||
name: 'My Cool Web App',
|
||||
build: '1978.4.1'
|
||||
|
@ -85,3 +93,5 @@ document.addEventListener('musickitloaded', function() {
|
|||
app.init()
|
||||
}, 1000)
|
||||
});
|
||||
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue