-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckAPI.js
More file actions
46 lines (42 loc) · 1.67 KB
/
checkAPI.js
File metadata and controls
46 lines (42 loc) · 1.67 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
const axios = require("axios");
const { log } = require("./utils"); // Menyesuaikan path sesuai kebutuhan
const settings = require("./config/config");
const urlChecking = "https://raw.githubusercontent.com/LinuxDil/APIs-checking/refs/heads/main/endpoints.json";
async function checkBaseUrl() {
console.log("Memeriksa API...".blue);
if (settings.ADVANCED_ANTI_DETECTION) {
const result = await getBaseApi(urlChecking);
if (result.endpoint) {
log("Tidak ada perubahan pada API!", "success");
return result;
}
} else {
return {
endpoint: settings.BASE_URL,
message:
"Jika API berubah, silakan hubungi tim tele Airdrop Seeker https://t.me/airdropseeker_official untuk informasi lebih lanjut dan pembaruan! | Jika ada masalah, harap hubungi: https://t.me/airdropseeker_official",
};
}
}
async function getBaseApi(url) {
try {
const response = await axios.get(url);
const content = response.data;
if (content?.animix) {
return { endpoint: content.animix, message: content.copyright };
} else {
return {
endpoint: null,
message:
"Jika API berubah, silakan hubungi tim tele Airdrop Seeker (https://t.me/airdropseeker_official) untuk informasi lebih lanjut dan pembaruan! | Jika ada masalah, harap hubungi: https://t.me/airdropseeker_official",
};
}
} catch (e) {
return {
endpoint: null,
message:
"Jika API berubah, silakan hubungi tim tele Airdrop Seeker (https://t.me/airdropseeker_official) untuk informasi lebih lanjut dan pembaruan! | Jika ada masalah, harap hubungi: https://t.me/airdropseeker_official",
};
}
}
module.exports = { checkBaseUrl };