-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
567 lines (526 loc) · 147 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
String.prototype.replaceAll = function(f,r){return this.split(f).join(r);}
Array.prototype.count = function() {
var count = 0;
for (var i=0; i<this.length; i++) {
if (this[i] != undefined) {
count++;
}
}
return count;
}
addEventListener('fetch', event => {
event.respondWith(handleRequest(event))
})
async function serveAsset(event) {
const url = new URL(event.request.url)
const cache = caches.default
let response = await cache.match(event.request)
if(url.pathname=="/favicon.ico") {
return new Response('{"success":false, "tracks": []}', { status: 400 });
}
if (!response) {
response = await fetch("https://www.monstercat.com/api/catalog"+url.pathname);
response = await response.json();
var tracks = response.Tracks;
console.log(tracks)
var outStr = '{"success":true, "trackNumber": '+tracks.slice(-1).pop().TrackNumber+', "tracks": [';
console.log(tracks.count());
var trackCount = tracks.count();
var i = 0;
var coverUrl = "https://www.monstercat.com"+url.pathname+"/cover";
for (let track of tracks) {
i++;
var streamUrl = "https://www.monstercat.com/api/release/"+track.Release.Id+"/track-stream/"+track.Id;
var index = i-1;
if(i >= trackCount) {
outStr += generateOutStr(track.Title, track.ArtistsTitle, streamUrl, track.CreatorFriendly, true, track.Artists, track.InEarlyAccess, coverUrl, track.Duration, index);
} else {
outStr += generateOutStr(track.Title, track.ArtistsTitle, streamUrl, track.CreatorFriendly, false, track.Artists, track.InEarlyAccess, coverUrl, track.Duration, index);
}
}
outStr += '], "releaseTitle":"'+response.Release.Title+'", "artistsTitle":"'+response.Release.ArtistsTitle+'", "catalogId":"'+response.Release.CatalogId+'"}';
//console.log(response.content)
var ctType = "application/json";
if(getParameterByName("metadata", event.request.url) != null && getParameterByName("metadata", event.request.url) != "") {
var metaId = getParameterByName("metadata", event.request.url);
var parsedJson = JSON.parse(outStr);
var metaOut = `
{
"title": "${parsedJson.tracks[metaId].title}",
"artist": "${parsedJson.tracks[metaId].artistsTitle}",
"album": "${parsedJson.ReleaseTitle}",
"artwork": [
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=96", "sizes": "96x96", "type": "image/png" },
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=128", "sizes": "128x128", "type": "image/png" },
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=192", "sizes": "192x192", "type": "image/png" },
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=256", "sizes": "256x256", "type": "image/png" },
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=384", "sizes": "384x384", "type": "image/png" },
{ "src": "${parsedJson.tracks[0].coverUrl}?image_width=512", "sizes": "512x512", "type": "image/png" }
]
}`;
const headers = { 'cache-control': 'public, max-age=14400', 'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json' }
response = new Response(metaOut, { headers });
event.waitUntil(cache.put(event.request, response.clone()));
return response;
}
if(getParameterByName("ui", event.request.url) != null) {
var parsedJson = JSON.parse(outStr);
ctType = "text/html";
outStr = `<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <link rel="icon" type="image/jpeg" href="${parsedJson.tracks[0].coverUrl}" /> <meta name="language" content="english"> <meta http-equiv="content-type" content="text/html"> <meta name="author" content="FlawCra"> <meta name="designer" content="FlawCra"> <meta name="publisher" content="FlawCra"> <meta name="no-email-collection" content="http://www.unspam.com/noemailcollection/"> <meta name="description" content="`+parsedJson.releaseTitle+` - `+parsedJson.artistsTitle;
if(getParameterByName("loop", event.request.url) != null) {
outStr += ` (loop`;
if(getParameterByName("autoplay", event.request.url) != null) {
outStr += ` & autoplay`;
}
outStr += ` enabled)`;
} else {
if(getParameterByName("autoplay", event.request.url) != null) {
outStr += ` (autoplay enabled)`;
}
}
outStr += `">
<meta name="robots" content="index,follow">
<meta name="revisit-after" content="7 days">
<meta name="distribution" content="web">
<meta name="robots" content="noodp">
<meta name="distribution" content="web">
<meta name="web_author" content="FlawCra">
<meta name="rating" content="general">
<meta name="title" content="FlawCra Monstercat API">
<meta property="og:image" content="https://cdn.flawcra.cc/2/DATA/874857577717475102/537981957870268783/profile.png">
<meta name="copyright" content="Copyright 2021">
<meta name="distribution" content="global">
<meta name="wot-verification" content="24bc7ac1360cd9630bd3"/>
<meta name="format-detection" content="telephone=yes"/>
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>`+parsedJson.releaseTitle+` - `+parsedJson.artistsTitle+`</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/css2?family=Teko:wght@300&display=swap" rel="stylesheet">
<style type="text/css">
.overlay2 {
position: absolute;
bottom: 0;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.5); /* Black see-through */
color: #f1f1f1;
width: 100%;
transition: .5s ease;
opacity:0;
color: white;
font-size: 20px;
padding: 20px;
text-align: center;
}
.overlay:hover {
opacity: 1;
}
body {
font-family: 'Teko', sans-serif;
background-color: #353535;
color: #fff;
}
.image-container {
position: relative;
width: 512px;
height: 512px;
margin-bottom: 64px;
}
.image-container .after {
display: block;
margin: 0;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
position: absolute;
}
.image-container:hover .after {
display: block;
}
.overlay {
background-color: rgba(0, 0, 0, 0.5);
}
body {
padding: 0;
margin: 0;
}
/*
Sliders begin
Snipet from https://www.w3schools.com/howto/howto_js_rangeslider.asp
*/
.slider {
-webkit-appearance: none;
width: 100%;
height: 25px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 25px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
.timeSlider {
-webkit-appearance: none;
width: 100%;
height: 25px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
}
.timeSlider:hover {
opacity: 1;
}
.timeSlider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
background: #0078d7;
cursor: pointer;
}
.timeSlider::-moz-range-thumb {
width: 25px;
height: 25px;
background: #0078d7;
cursor: pointer;
}
// Sliders end
.gold {
border: 5px solid #daa520;
border-radius: 5px;
}
.center {
margin: auto;
width: 60%;
height: auto;
text-align: center;
}
.content {
position: fixed;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
color: #f1f1f1;
width: 100%;
padding: 20px;
z-index: 1000;
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pizzicato/0.6.4/Pizzicato.min.js" integrity="sha512-K+cPWcoDCr2JFFfe912LrvRUQbVJuWNfeWK5r/HrmpDs8ELrsjVib8Fs5oAxzu76fG66ajGhDLvvcxBbeEzl9g==" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/gh/diy/intercom.js/intercom.min.js" crossorigin="anonymous"></script>
</head> <body onload='$(".gold").trigger("resize.sparkle");'>`;
outStr += `
<div class="content center">
<input type="range" min="0" max="100" value="50" class="slider center" id="volumeSlider"> <input type="range" min="0" max="100" value="0" class="timeSlider center" id="timeSlider">
</div>
`;
outStr += `<script>var playImg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAABmJLR0QA/wD/AP+gvaeTAAADPklEQVR4nO3a3UtTcRzH8e85Hrfj3HyuZji0B0VELR9mN0F6EaaWQ6OLruqmgi6ihExcifgQRTdBQbfRRRd2YWVzaoVeBGLdRV4550QnaiqzrbmznYeuTlRESWvn9zvyff0Dvy9vGHwGBwAhhBBCCCGEEEIIIYQQQgghpHOOzuE3zZ3uctJ3JAqT6AeaO11KEstuAcsOAAvtg931q4l+U0usFo/UHLGn7LVazyqi7HPcHOmr7R7ntXhXC5oE5DgOCvblG6qrKlNysrOuZko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E9oREVHMHpSaEdBWm8yeGFpS0RMeVBHZVN5UE04c0N4cjg2OCtXQy9tdnU5ajEzWEJ0bTFBQ01FOHo3QXNDL1I5cjBmR09mK2FyT3U2alV3UzdsNnRUL0IreG8rYURGUm81QnlrSGZhdjMvZ1NZQUF0SWRRMUlUMHB1QUFBQUFCSlJVNUVya0pnZ2c9PSJ9fShqUXVlcnkpOw=="))</script>`;
outStr += `<script>
var intercom = Intercom.getInstance();
intercom.on('sync', function(sync) {
switch(sync.command) {
case "pause_all":
for (var a of document.getElementsByTagName("audio")) {
if(!a.paused)
a.pause();
}
for (var b of document.getElementsByTagName("img")) {
if(b.getAttribute("id") && b.getAttribute("id").startsWith("overlay-")) {
b.setAttribute("src", playImg);
}
}
break;
case "setVol":
window["volumeSlider"].value = sync.param * 100;
for (var a of document.getElementsByTagName("audio")) {
a.volume = sync.param;
}
break;
}
});
window["lastUid"] = "";
window["timeSlider"] = document.getElementById("timeSlider");
window["volumeSlider"] = document.getElementById("volumeSlider");
function registerVariables(uid, overlayDom, audioDom, timeDom, volDom, coverDom, timeSliderDom, link) {
coverDom.onloaded = () => {
$(".gold").trigger("resize.sparkle");
};
window["time-"+uid] = timeDom;
audioDom.src = link;
//var aud = new Pizzicato.Sound(link, function() { });
//aud.connect(audioDom);
//window["audiodriver-"+uid] = aud;
window["audio-"+uid] = audioDom;
audioDom.volume = 0.5;
window["overlay-"+uid] = overlayDom;
window["cover-"+uid] = coverDom;
window["overlay-"+uid].src = playImg;
window["audio-"+uid].ontimeupdate = function() {
setProgress(window["audio-"+uid], window["time-"+uid], uid);
};
window["audio-"+uid].onended = function() {
window["overlay-"+uid].src = playImg;
window["audio-"+uid].currentTime = 0;
setProgress(window["audio-"+uid], window["time-"+uid], uid);
};
window["audio-"+uid].onloadedmetadata = function() {
setProgress(window["audio-"+uid], window["time-"+uid], uid);
};
window["audio-"+uid].volume = 0.5;
window["audio-"+uid].setAttribute("bassboost",false);
}
function togglePlayPause(songUid) {
if (window["audio-"+songUid].paused) {
intercom.emit('sync', {command: "pause_all"});
if(window["lastUid"] != songUid) {
fetch("?metadata="+window["audio-"+songUid].getAttribute("index"), {
"credentials": "omit",
"headers": {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0",
"Accept": "*/*",
"Accept-Language": "en-US,en;q=0.5",
"Pragma": "no-cache",
"Cache-Control": "no-cache"
},
"method": "GET",
"mode": "cors"
}).then(async (metadataRequest) => {
var metadata = await metadataRequest.json();
navigator.mediaSession.metadata = new MediaMetadata({
title: metadata.title,
artist: metadata.artist,
album: metadata.album,
artwork: metadata.artwork
});
});
//console.log("new uid: "+songUid);
window["currentUid"] = songUid;
window["timeSlider"].oninput = null;
window["timeSlider"].max = window["audio-"+songUid].duration;
window["timeSlider"].oninput = function() {
window["audio-"+songUid].currentTime = window["timeSlider"].value;
};
window["lastUid"] = songUid;
}
window["audio-"+songUid].play();
window["overlay-"+songUid].src = pauseImg;
navigator.mediaSession.playbackState = "playing";
} else {
window["audio-"+songUid].pause();
window["overlay-"+songUid].src = playImg;
navigator.mediaSession.playbackState = "paused";
}
}
function convertElapsedTime(inputSeconds) {
var seconds = Math.floor(inputSeconds % 60);
if(seconds < 10) {
seconds = "0"+seconds;
}
var minutes = Math.floor(inputSeconds / 60);
return minutes + ":" + seconds;
}
function setProgress(aud, timeElem, uid) {
updatePositionState();
var currentTime = aud.currentTime;
var duration = aud.duration;
window["timeSlider"].value = aud.currentTime;
timeElem.innerHTML = convertElapsedTime(currentTime) + "/" + convertElapsedTime(duration);
var percentage = currentTime / duration;
}
function updatePositionState() {
var audioEl = window["audio-"+window["currentUid"]];
navigator.mediaSession.setPositionState({
duration: audioEl.duration,
playbackRate: audioEl.playbackRate,
position: audioEl.currentTime
});
}
window["volumeSlider"].oninput = function() {
intercom.emit('sync', {command: "setVol", param: (window["volumeSlider"].value / 100)});
};
</script>
`;
var uuid = uuidv4().replaceAll("-","_");
for (var item of parsedJson.tracks) {
uuid = uuidv4().replaceAll("-","_");
outStr += `
<div class='group' id='group-${uuid}'>
<h1 class='center'>${item.title} - ${item.artistsTitle}</h1>
<div class="image-container center">
<img class='center' id='cover-${uuid}' onclick='togglePlayPause("${uuid}");' src="${item.coverUrl}" />
<div class="after" onclick='togglePlayPause("${uuid}");'>
<img class='center toggleBtn' id="overlay-${uuid}" src="" />
<div class="overlay center" id="time-${uuid}">0:00</div>
</div>
</div>
<audio id="audio-${uuid}" volume='0.5' index="${item.index}" style='display: none;'></audio>
<script class="remove" type='text/javascript'>
registerVariables("${uuid}",
document.getElementById("overlay-${uuid}"),
document.getElementById("audio-${uuid}"),
document.getElementById("time-${uuid}"),
null,
document.getElementById("cover-${uuid}"),
null,
"${item.streamUrl}"
);
</script>
</div>`;
if(item.inEarlyAccess) {
outStr += `<script class="remove"> window["cover-${uuid}"].classList.add("gold");</script>`;
}
if(getParameterByName("loop", event.request.url) != null) {
outStr += `<script class="remove">window["audio-${uuid}"].setAttribute("loop", 1);</script>`;
}
}
if(getParameterByName("autoplay", event.request.url) != null) {
outStr += `
<script class="remove">
document.getElementsByClassName("toggleBtn")[0].src = pauseImg;
document.getElementsByTagName("audio")[0].setAttribute("autoplay", 1);
</script>`;
}
outStr += `
<script class="remove" id="lastRemove">
$(".gold").sparkle({
color: "#daa520",
count: 50,
overlap: 0,
speed: 1,
minSize: 5,
maxSize: 10,
direction: "both"
});
$(".gold").off("mouseover.sparkle")
.off("mouseout.sparkle")
.off("focus.sparkle")
.off("blur.sparkle")
.trigger("start.sparkle");
var timer;
$(window).on("resize", function(){
clearTimeout(timer);
timer = setTimeout(function(){
$(".gold").trigger("resize.sparkle");
},200);
});
intercom.emit('sync', {command: "setVol", param: 0.5});
navigator.mediaSession.setActionHandler('play', async function() {
togglePlayPause(window["currentUid"]);
});
navigator.mediaSession.setActionHandler('pause', function() {
togglePlayPause(window["currentUid"]);
});
let defaultSkipTime = 10; /* Time to skip in seconds by default */
navigator.mediaSession.setActionHandler('seekbackward', function(event) {
var audio = window["audio-"+window["currentUid"]];
const skipTime = event.seekOffset || defaultSkipTime;
audio.currentTime = Math.max(audio.currentTime - skipTime, 0);
updatePositionState();
});
navigator.mediaSession.setActionHandler('seekforward', function(event) {
var audio = window["audio-"+window["currentUid"]];
const skipTime = event.seekOffset || defaultSkipTime;
audio.currentTime = Math.min(audio.currentTime + skipTime, audio.duration);
updatePositionState();
});
for(var _ of document.getElementsByClassName("remove")) {
if(_.hasAttribute("id")) {
if(_.getAttribute("id") != "lastRemove") {
_.remove();
}
}
else {
_.remove();
}
}
document.getElementById("lastRemove").remove();
</script>`;
outStr += `</body> </html>`;
}
const headers = { 'cache-control': 'public, max-age=14400', 'Access-Control-Allow-Origin': '*', 'Content-Type': ctType }
response = new Response(outStr, { headers })
event.waitUntil(cache.put(event.request, response.clone()))
}
return response
}
function generateOutStr(trackTitle, artistsTitle, streamUrl, creatorFriendly, isLast, artists, inEarlyAccess, coverUrl, duration, index) {
var isFriendly = "false";
var isEarlyAccess = "false";
var tmp;
if(creatorFriendly) {
isFriendly = "true";
}
if(inEarlyAccess) {
isEarlyAccess = "true";
}
var internalArtists = [];
var artistCount = artists.length;
for (let artist of artists) {
internalArtists.push({"name":artist.name,"role":artist.role});
}
tmp = "{";
tmp += '"index":"'+index+'",';
tmp += '"title":"'+trackTitle+'",';
tmp += '"artists":'+JSON.stringify(internalArtists)+',';
tmp += '"artistsTitle":"'+artistsTitle+'",';
tmp += '"streamUrl":"'+streamUrl+'",';
tmp += '"coverUrl":"'+coverUrl+'",';
tmp += '"duration":'+duration+',';
tmp += '"creatorFriendly":'+isFriendly+',';
tmp += '"inEarlyAccess":'+isEarlyAccess+'';
tmp += '}';
if(!isLast) {
tmp += ',';
}
return tmp
}
function uuidv4() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
function getParameterByName(name, url) {
name = name.replace(/[\[\]]/g, '\\$&')
name = name.replace(/\//g, '')
var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)'),
results = regex.exec(url)
if (!results) return null
else if (!results[2]) return ''
else if (results[2]) {
results[2] = results[2].replace(/\//g, '')
}
return decodeURIComponent(results[2].replace(/\+/g, ' '));
}
async function handleRequest(event) {
if (event.request.method === 'GET') {
let response = await serveAsset(event)
if (response.status > 399) {
var outStr = '{"success":false,"tracks":[]}';
response = new Response('{"success":false,"tracks":[]}', { status: response.status })
}
return response
} else {
return new Response('Method not allowed', { status: 405 })
}
}