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html lang='en'>
|
3 |
+
<head>
|
4 |
+
<title>N/A</title>
|
5 |
+
<meta charset='utf-8'>
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.00">
|
7 |
+
<meta name="robots" content="noindex,nofollow,noarchive">
|
8 |
+
<script src="https://code.jquery.com/jquery-3.6.1.min.js" integrity="sha256-o88AwQnZB+VDvE9tvIXrMQaPlFFSUTR+nldQm1LuPXQ=" crossorigin="anonymous"></script>
|
9 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js" integrity="sha512-6+YN/9o9BWrk6wSfGxQGpt3EUK6XeHi6yeHV+TYD2GR0Sj/cggRpXr1BrAQf0as6XslxomMUxXp2vIl+fv0QRA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
10 |
+
<script src="https://cdn.plyr.io/3.7.3/plyr.js"></script>
|
11 |
+
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest/dist/hls.min.js"></script>
|
12 |
+
<link rel="stylesheet" href="https://cdn.plyr.io/3.7.3/plyr.css" />
|
13 |
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
|
14 |
+
<link href="https://cdn.jsdelivr.net/gh/daydreamer-json/SomeFontRepo@main/somefontrepo.css" rel="stylesheet" type="text/css" media="all">
|
15 |
+
<style>
|
16 |
+
html, body {
|
17 |
+
color: #fff;
|
18 |
+
background: #000;
|
19 |
+
margin: 0;
|
20 |
+
padding: 0;
|
21 |
+
line-height: 1;
|
22 |
+
width: 100vw;
|
23 |
+
height: 100vh;
|
24 |
+
font-family: 'SDK_JP_Web', system-ui;
|
25 |
+
}
|
26 |
+
#h2string1 {
|
27 |
+
margin: 0;
|
28 |
+
padding: 0;
|
29 |
+
line-height: 1;
|
30 |
+
}
|
31 |
+
#main {
|
32 |
+
position: absolute;
|
33 |
+
top: 50%;
|
34 |
+
left: 50%;
|
35 |
+
transform: translate(-50%, -50%);
|
36 |
+
text-align: center;
|
37 |
+
margin: 0;
|
38 |
+
padding: 0;
|
39 |
+
white-space: normal;
|
40 |
+
letter-spacing: -0.02em;
|
41 |
+
text-shadow: 0 0 30px #cccccc;
|
42 |
+
z-index: 100;
|
43 |
+
}
|
44 |
+
#cover_bg_container {
|
45 |
+
width: 100vw;
|
46 |
+
height: 100vh;
|
47 |
+
overflow: hidden;
|
48 |
+
}
|
49 |
+
#cover_bg {
|
50 |
+
z-index: 95;
|
51 |
+
width: 100vw;
|
52 |
+
height: 100vh;
|
53 |
+
opacity: 0.3;
|
54 |
+
object-fit: cover;
|
55 |
+
object-position: 50% 50%;
|
56 |
+
}
|
57 |
+
.do-not-select {
|
58 |
+
user-select: none;
|
59 |
+
}
|
60 |
+
.do-not-bold {
|
61 |
+
font-weight: normal;
|
62 |
+
}
|
63 |
+
</style>
|
64 |
+
</head>
|
65 |
+
<body>
|
66 |
+
<div id='cover_bg_container'>
|
67 |
+
<img id='cover_bg' src='' style='display: none;'>
|
68 |
+
</div>
|
69 |
+
<div id='main'>
|
70 |
+
<h2 id='h2string1' class='do-not-select do-not-bold'> </h1>
|
71 |
+
<h1 id='h1string1' class='do-not-select do-not-bold'> </h1>
|
72 |
+
<div id='trackInfo' class='do-not-select'>
|
73 |
+
<h3 id='trackInfo_trackName' class='do-not-bold' style='display: none;'> </h3>
|
74 |
+
<h4 id='trackInfo_albumName' class='do-not-bold' style='display: none;'> </h4>
|
75 |
+
<h4 id='trackInfo_artistName' class='do-not-bold' style='display: none;'> </h4>
|
76 |
+
<p id='trackInfo_copyright' style='display: none;'> </p>
|
77 |
+
</div>
|
78 |
+
</div>
|
79 |
+
<script>
|
80 |
+
const BASE_SETTINGS = {
|
81 |
+
base64var: {
|
82 |
+
pageTitle: 'R2Vuc2hpbiBJbXBhY3QgTXVzaWMgSnVrZWJveA==',
|
83 |
+
h2string1: 'R2Vuc2hpbiBJbXBhY3QgTXVzaWMgSnVrZWJveA=='
|
84 |
+
},
|
85 |
+
audioRootURL: 'https://raw.githubusercontent.com/daydreamer-json/discography_cdn_005/main/mhy/genshin',
|
86 |
+
playStartButtonText_init_pc: 'CLICK TO PLAY',
|
87 |
+
playStartButtonText_init_mobile: 'TAP TO PLAY',
|
88 |
+
playStartButtonText_loading: 'LOADING ...',
|
89 |
+
playStartButtonText_playing: 'NOW PLAYING',
|
90 |
+
trackInfoLabel_loading: 'Loading ...',
|
91 |
+
forceCompressedFormat: true
|
92 |
+
};
|
93 |
+
function detectMobileDevice() {
|
94 |
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
|
95 |
+
return 'mobile'
|
96 |
+
} else {
|
97 |
+
return 'pc'
|
98 |
+
}
|
99 |
+
}
|
100 |
+
function display_deobfuscate() {
|
101 |
+
document.title = atob(BASE_SETTINGS.base64var.pageTitle);
|
102 |
+
document.getElementById('h2string1').textContent = atob(BASE_SETTINGS.base64var.h2string1);
|
103 |
+
}
|
104 |
+
function randomTrackSelector(db) {
|
105 |
+
let randomizedAlbumIndex = Math.floor(Math.random() * db.list.length);
|
106 |
+
let randomizedDiscIndex = Math.floor(Math.random() * db.list[randomizedAlbumIndex].discs.length);
|
107 |
+
let randomizedTrackIndex = Math.floor(Math.random() * db.list[randomizedAlbumIndex].discs[randomizedDiscIndex].tracks.length);
|
108 |
+
return {
|
109 |
+
albumIndex: randomizedAlbumIndex,
|
110 |
+
discIndex: randomizedDiscIndex,
|
111 |
+
trackIndex: randomizedTrackIndex
|
112 |
+
};
|
113 |
+
}
|
114 |
+
function playAudioURLBuilder(db, randomTrackSelectorOutput) {
|
115 |
+
let deviceType = detectMobileDevice();
|
116 |
+
/*
|
117 |
+
let bpsArray = new Array();
|
118 |
+
for (let i = 0; i < db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length; i++) {
|
119 |
+
bpsArray.push(db.list[randomTrackSelectorOutput.albumIndex].availableFmts[i].bps);
|
120 |
+
};
|
121 |
+
bpsArray.sort((a, b) => b - a);
|
122 |
+
*/
|
123 |
+
let formatPath = '';
|
124 |
+
let formatExt = '';
|
125 |
+
if (BASE_SETTINGS.forceCompressedFormat) {
|
126 |
+
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].path;
|
127 |
+
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].ext;
|
128 |
+
} else if (deviceType == 'pc') {
|
129 |
+
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[0].path;
|
130 |
+
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[0].ext;
|
131 |
+
} else if (deviceType == 'mobile') {
|
132 |
+
formatPath = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].path;
|
133 |
+
formatExt = db.list[randomTrackSelectorOutput.albumIndex].availableFmts[db.list[randomTrackSelectorOutput.albumIndex].availableFmts.length - 1].ext;
|
134 |
+
}
|
135 |
+
let trackTotal = 0;
|
136 |
+
let trackCountArray = new Array();
|
137 |
+
for (let i = 0; i < db.list[randomTrackSelectorOutput.albumIndex].discs.length; i++) {
|
138 |
+
trackTotal += db.list[randomTrackSelectorOutput.albumIndex].discs[i].tracks.length;
|
139 |
+
trackCountArray.push(db.list[randomTrackSelectorOutput.albumIndex].discs[i].tracks.length);
|
140 |
+
};
|
141 |
+
let selectedTrackNum = 0;
|
142 |
+
if (randomTrackSelectorOutput.discIndex == 0) {
|
143 |
+
selectedTrackNum = randomTrackSelectorOutput.trackIndex + 1;
|
144 |
+
} else {
|
145 |
+
let E7BF25ECDBAAF938 = 0;
|
146 |
+
for (let i = 0; i < randomTrackSelectorOutput.discIndex; i++) {
|
147 |
+
E7BF25ECDBAAF938 += trackCountArray[i];
|
148 |
+
}
|
149 |
+
selectedTrackNum = E7BF25ECDBAAF938 + randomTrackSelectorOutput.trackIndex + 1;
|
150 |
+
}
|
151 |
+
let selectedTrackNumStr = '';
|
152 |
+
if (trackTotal >= 100) {
|
153 |
+
selectedTrackNumStr = selectedTrackNum.toString().padStart(3, '0');
|
154 |
+
} else if (trackTotal < 100) {
|
155 |
+
selectedTrackNumStr = selectedTrackNum.toString().padStart(2, '0');
|
156 |
+
}
|
157 |
+
let filename = encodeURIComponent(db.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US'].replace(/'/g, '_'));
|
158 |
+
let buildedURL = `${BASE_SETTINGS.audioRootURL}/${db.list[randomTrackSelectorOutput.albumIndex].rootPath}/${formatPath}/${selectedTrackNumStr}_${filename}.${formatExt}`;
|
159 |
+
return buildedURL;
|
160 |
+
}
|
161 |
+
function playAudio() {
|
162 |
+
document.getElementById('h1string1').removeEventListener('click', playAudio);
|
163 |
+
if (typeof audioPlayer !== 'undefined') {
|
164 |
+
audioPlayer.unload();
|
165 |
+
};
|
166 |
+
fetch(`${BASE_SETTINGS.audioRootURL}/db.json`)
|
167 |
+
.then(response => response.json())
|
168 |
+
.then(data => {
|
169 |
+
console.log('Database loaded successfully');
|
170 |
+
const FILE_DATABASE = data;
|
171 |
+
let deviceType = detectMobileDevice();
|
172 |
+
let randomTrackSelectorOutput = randomTrackSelector(FILE_DATABASE);
|
173 |
+
var audioPlayer = new Howl ({
|
174 |
+
src: [playAudioURLBuilder(FILE_DATABASE, randomTrackSelectorOutput)],
|
175 |
+
html5: true
|
176 |
+
});
|
177 |
+
window.audioPlayer = audioPlayer;
|
178 |
+
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_loading;
|
179 |
+
document.getElementById('trackInfo_trackName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
|
180 |
+
document.getElementById('trackInfo_albumName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
|
181 |
+
document.getElementById('trackInfo_artistName').textContent = BASE_SETTINGS.trackInfoLabel_loading;
|
182 |
+
document.getElementById('trackInfo_copyright').textContent = BASE_SETTINGS.trackInfoLabel_loading;
|
183 |
+
audioPlayer.on('load', function(){
|
184 |
+
audioPlayer.play();
|
185 |
+
document.getElementById('h1string1').addEventListener('click', playAudio);
|
186 |
+
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_playing;
|
187 |
+
console.log(`Now playing "${FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US']}"`);
|
188 |
+
console.log(`URL: ${audioPlayer._src}`);
|
189 |
+
document.getElementById('trackInfo_trackName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].discs[randomTrackSelectorOutput.discIndex].tracks[randomTrackSelectorOutput.trackIndex].trackName['en-US'];
|
190 |
+
document.getElementById('trackInfo_albumName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].albumTitle;
|
191 |
+
document.getElementById('trackInfo_artistName').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].albumArtist;
|
192 |
+
document.getElementById('trackInfo_copyright').textContent = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].copyright;
|
193 |
+
document.getElementById('cover_bg').src = FILE_DATABASE.list[randomTrackSelectorOutput.albumIndex].coverExtLink;
|
194 |
+
if (document.getElementById('trackInfo_trackName').style.display == 'none' && document.getElementById('trackInfo_albumName').style.display == 'none' && document.getElementById('trackInfo_artistName').style.display == 'none' && document.getElementById('trackInfo_copyright').style.display == 'none' && document.getElementById('cover_bg').style.display == 'none') {
|
195 |
+
document.getElementById('trackInfo_trackName').style.display = 'block';
|
196 |
+
document.getElementById('trackInfo_albumName').style.display = 'block';
|
197 |
+
document.getElementById('trackInfo_artistName').style.display = 'block';
|
198 |
+
document.getElementById('trackInfo_copyright').style.display = 'block';
|
199 |
+
document.getElementById('cover_bg').style.display = 'block';
|
200 |
+
}
|
201 |
+
audioPlayer.on('end', playAudio);
|
202 |
+
});
|
203 |
+
})
|
204 |
+
.catch(error => {
|
205 |
+
console.error(error);
|
206 |
+
alert('Failed to load database file');
|
207 |
+
});
|
208 |
+
}
|
209 |
+
document.addEventListener('DOMContentLoaded', function() {
|
210 |
+
display_deobfuscate();
|
211 |
+
let deviceType = detectMobileDevice();
|
212 |
+
if (deviceType == 'pc') {
|
213 |
+
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_init_pc;
|
214 |
+
} else if (deviceType == 'mobile') {
|
215 |
+
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_init_mobile;
|
216 |
+
};
|
217 |
+
var audioPlayer = new Howl ({
|
218 |
+
src: ['https://archive.org/download/audio-silent-wavs-one-second-half-second-quarter-second/silent_quarter-second.mp3']
|
219 |
+
});
|
220 |
+
window.audioPlayer = audioPlayer;
|
221 |
+
});
|
222 |
+
window.onload = function () {
|
223 |
+
document.getElementById('h1string1').addEventListener('click', playAudio);
|
224 |
+
}
|
225 |
+
</script>
|
226 |
+
</body>
|
227 |
+
</html>
|
hi_jukebox.html
CHANGED
@@ -171,7 +171,8 @@
|
|
171 |
let deviceType = detectMobileDevice();
|
172 |
let randomTrackSelectorOutput = randomTrackSelector(FILE_DATABASE);
|
173 |
var audioPlayer = new Howl ({
|
174 |
-
src: [playAudioURLBuilder(FILE_DATABASE, randomTrackSelectorOutput)]
|
|
|
175 |
});
|
176 |
window.audioPlayer = audioPlayer;
|
177 |
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_loading;
|
|
|
171 |
let deviceType = detectMobileDevice();
|
172 |
let randomTrackSelectorOutput = randomTrackSelector(FILE_DATABASE);
|
173 |
var audioPlayer = new Howl ({
|
174 |
+
src: [playAudioURLBuilder(FILE_DATABASE, randomTrackSelectorOutput)],
|
175 |
+
html5: true
|
176 |
});
|
177 |
window.audioPlayer = audioPlayer;
|
178 |
document.getElementById('h1string1').textContent = BASE_SETTINGS.playStartButtonText_loading;
|