-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmusicpack-dl.html
More file actions
74 lines (67 loc) · 2.84 KB
/
musicpack-dl.html
File metadata and controls
74 lines (67 loc) · 2.84 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download latest music pack for Minecraft Bedrock</title>
<style>
/* Use default browser sans-serif font */
body {
font-family: sans-serif;
}
</style>
<script>
// Function to fetch release details from GitHub API
function fetchReleaseDetails() {
fetch('https://api.github.com/repos/mcpebd/musicpack/releases/latest')
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(releaseData => {
const tagName = releaseData.tag_name;
const releaseDescription = releaseData.body || 'No description available';
const codeBlockMatch = releaseDescription.match(/`([^`]+)`/);
const targetVersion = codeBlockMatch ? codeBlockMatch[1] : "Unknown version";
document.getElementById('targetVersion').textContent = targetVersion;
const asset = releaseData.assets.find(a => a.name === 'musicpack.zip.mcpack');
if (asset) {
const sizeMB = (asset.size / (1024 * 1024)).toFixed(0);
document.getElementById('downloadButtonContainer').innerHTML = `
<a href="${asset.browser_download_url}">
<button type="button">Download music pack (${sizeMB} MB)</button>
</a>
`;
} else {
document.getElementById('downloadButtonContainer').textContent = 'File not found :(';
}
})
.catch(error => {
console.error('Error fetching release details:', error);
document.getElementById('error').textContent = 'Failed to get details.';
});
}
document.addEventListener('DOMContentLoaded', fetchReleaseDetails);
</script>
</head>
<body>
<h2><img src="https://github.com/user-attachments/assets/07835c2f-c98e-4351-9a00-cdf708bb741f" style="height: 1.2em; vertical-align: -15%; display: inline-block;">
Download latest music pack for Minecraft Bedrock</h2>
<p id="error" style="color: red;"></p>
<p><b>Note:</b> Current music pack is for <b><span id="targetVersion">Loading...</span></b></p>
<br>
<p id="downloadButtonContainer">
<button type="button" disabled>Getting download details...</button>
</p>
<p>
<a href="https://github.com/mcpebd/musicpack/releases/">
<button type="button">See older music packs</button>
</a>
</p>
<br>
<img src="https://img.shields.io/github/downloads/faizul726/oreui-utilities/total.svg?label=Lifetime downloads&color=blue">
<p>Thank you and have a good day!</p>
</body>
</html>