Skip to content

Commit d5e37f8

Browse files
authored
Use source for downloads
1 parent bad3c53 commit d5e37f8

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

index.html

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,22 +247,39 @@
247247
</script>
248248
<script>
249249
async function fetchChangelog(repo, elementId, downloadButtonId) {
250-
const url = `https://api.github.com/repos/SpotCompiled/${repo}/releases/latest`;
250+
const ghUrl = `https://api.github.com/repos/SpotCompiled/${repo}/releases/latest`;
251+
let sourceUrl = `https://raw.githubusercontent.com/SpotCompiled/SpotC-Repo/refs/heads/main/Scarlet%20Repo.json`;
251252
try {
252-
const response = await fetch(url);
253-
const data = await response.json();
253+
const ghResponse = await fetch(ghUrl);
254+
const ghData = await ghResponse.json();
254255
const changelogElement = document.getElementById(elementId);
255256

257+
if (repo === 'SpotilifeC') {
258+
sourceUrl = `https://raw.githubusercontent.com/SpotCompiled/SpotC-Repo/refs/heads/main/AltStore%20Repo.json`;
259+
}
260+
261+
const sourceResponse = await fetch(sourceUrl);
262+
const sourceData = await sourceResponse.json();
263+
264+
let app = "";
265+
if (repo === 'SpotC-Plus-Plus') {
266+
app = sourceData.apps.find(app => app.name === 'SpotC++');
267+
} else if (repo === 'SpotveeC') {
268+
app = sourceData.apps.find(app => app.name === 'SpotveeC');
269+
} else if (repo === 'SpotilifeC') {
270+
app = sourceData.apps.find(app => app.name === 'SpotilifeC');
271+
}
272+
256273
// Extract latest version
257-
const latestVersion = data.tag_name;
274+
const latestVersion = ghData.tag_name;
258275

259276
// Extract download URL for IPA file
260-
const downloadUrl = data.assets.find(asset => asset.name.endsWith('.ipa') && !asset.name.includes('ALTSTORE')).browser_download_url;
277+
const downloadUrl = app.downloadURL;
261278

262279
// Remove everything after "***"
263-
const endIndex = data.body.indexOf('***');
280+
const endIndex = ghData.body.indexOf('***');
264281
if (endIndex !== -1) {
265-
cleanChangelog = data.body.substring(0, endIndex);
282+
cleanChangelog = ghData.body.substring(0, endIndex);
266283
}
267284

268285
// Split the changelog text by newline

0 commit comments

Comments
 (0)