gj-boomlings-api 1.5.7 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +31 -7
- package/functions/blockUser.js +29 -30
- package/functions/deleteAccountPost.js +22 -32
- package/functions/deleteComment.js +20 -20
- package/functions/deleteLevel.js +23 -29
- package/functions/dlLevel.js +157 -6
- package/functions/dlMessage.js +30 -36
- package/functions/getAccountPosts.js +23 -36
- package/functions/getBlockedList.js +47 -63
- package/functions/getCommentHistory.js +59 -39
- package/functions/getComments.js +46 -27
- package/functions/getCreatorScores.js +18 -30
- package/functions/getDailyLevel.js +5 -9
- package/functions/getFriendsList.js +48 -56
- package/functions/getGauntlets.js +18 -24
- package/functions/getLevelByID.js +9 -156
- package/functions/getLevelScores.js +63 -46
- package/functions/getMapPacks.js +40 -28
- package/functions/getMessages.js +36 -41
- package/functions/getOfficialSongInfo.js +9 -87
- package/functions/getProfile.js +159 -7
- package/functions/getSongInfo.js +22 -31
- package/functions/getSongsLibrary.js +80 -0
- package/functions/getTab.js +16 -7
- package/functions/getTop100.js +18 -27
- package/functions/getTopLists.js +14 -0
- package/functions/getUserLevels.js +24 -88
- package/functions/getWeeklyDemon.js +5 -9
- package/functions/reportLevel.js +9 -22
- package/functions/searchLevels.js +15 -84
- package/functions/searchLists.js +15 -0
- package/functions/unblockUser.js +29 -30
- package/functions/updateLevelDesc.js +27 -43
- package/functions/uploadAccountPost.js +23 -36
- package/functions/uploadComment.js +43 -57
- package/functions/uploadMessage.js +32 -41
- package/gjReq.js +18 -0
- package/index.js +36 -1
- package/misc/GJDecode.js +210 -1
- package/misc/colors.json +1 -1
- package/misc/gauntlets.json +1 -0
- package/misc/officialsongs.json +1 -1
- package/misc/rgbToHEX.js +1 -1
- package/package.json +2 -6
- package/.nvmrc +0 -1
- package/config.json +0 -1
- package/functions/searchUsers.js +0 -27
- package/misc/decB64.js +0 -4
- package/misc/demonlist.js +0 -1
- package/misc/encB64.js +0 -1
- package/misc/gjReq.js +0 -1
- package/misc/gjWReq.js +0 -1
- package/misc/gjp.js +0 -1
- /package/{misc/xor.js → xor.js} +0 -0
|
@@ -1,162 +1,15 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
/**
|
|
3
|
-
* Gets the basic level info by its ID.
|
|
4
|
-
*
|
|
5
|
-
* It's the same as dlLevel(), but it works faster and doesn't provide the password, update date, upload date, the info about LDM and an accurate object counter.
|
|
6
|
-
*
|
|
7
|
-
* By the way, GD uses this for search results.
|
|
8
|
-
* @param {*} id - The level ID.
|
|
9
|
-
*/
|
|
10
2
|
getLevelByID: async function (id) {
|
|
11
|
-
if (
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
gjWReq
|
|
18
|
-
} = require("../misc/gjWReq.js");
|
|
19
|
-
const {
|
|
20
|
-
secret
|
|
21
|
-
} = require("../config.json");
|
|
22
|
-
const {
|
|
23
|
-
decB64
|
|
24
|
-
} = require("../misc/decB64.js");
|
|
25
|
-
const data = {
|
|
26
|
-
secret: secret,
|
|
3
|
+
if (isNaN(id)) throw new Error("Please provide a valid level ID!");
|
|
4
|
+
const { gjReq } = require("../gjReq");
|
|
5
|
+
const GJDecode = require("../misc/GJDecode");
|
|
6
|
+
const { decodeSearchResults } = new GJDecode;
|
|
7
|
+
const res = await gjReq("getGJLevels21", {
|
|
8
|
+
secret: "Wmfd2893gb7",
|
|
27
9
|
str: id,
|
|
28
10
|
type: 0
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if (res.data == "error code: 1005") {
|
|
33
|
-
res = await gjWReq("getLevelByID", id);
|
|
34
|
-
if (res.status == 403) throw new Error(res.data.error);
|
|
35
|
-
return res.data
|
|
36
|
-
}
|
|
37
|
-
async function decodeLevel(l) {
|
|
38
|
-
let spl = l.split(":");
|
|
39
|
-
let lInfo = [];
|
|
40
|
-
for (let i = 0; i < spl.length; i++) {
|
|
41
|
-
if (i % 2 != 0) {
|
|
42
|
-
lInfo.push(spl[i - 1] + `:` + spl[i])
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
let id = lInfo[0].split("1:")[1];
|
|
46
|
-
let name = lInfo[1].split("2:")[1];
|
|
47
|
-
let version = lInfo[2].split("5:")[1];
|
|
48
|
-
let difficulty = lInfo[5].split("9:")[1];
|
|
49
|
-
let downloads = lInfo[6].split("10:")[1];
|
|
50
|
-
let officialSong = lInfo[7].split("12:")[1];
|
|
51
|
-
let gameVersion = lInfo[8].split("13:")[1];
|
|
52
|
-
let likes = lInfo[9].split("14:")[1];
|
|
53
|
-
let demonBool = lInfo[10].split("17:")[1];
|
|
54
|
-
let stars = lInfo[13].split("18:")[1];
|
|
55
|
-
let ftrd = lInfo[14].split("19:")[1];
|
|
56
|
-
let epic = lInfo[15].split("42:")[1];
|
|
57
|
-
let objs = lInfo[16].split("45:")[1];
|
|
58
|
-
let desc = lInfo[17].split("3:")[1];
|
|
59
|
-
let length = lInfo[18].split("15:")[1];
|
|
60
|
-
let copiedID = lInfo[19].split("30:")[1];
|
|
61
|
-
let twoPlayer = lInfo[20].split("31:")[1];
|
|
62
|
-
let coins = lInfo[21].split("37:")[1];
|
|
63
|
-
let verifiedCoins = lInfo[22].split("38:")[1];
|
|
64
|
-
let starsRequested = lInfo[23].split("39:")[1];
|
|
65
|
-
let customSong = lInfo[26].split("35:")[1].split("#")[0];
|
|
66
|
-
let author = res.data.split("#")[1].includes(":") ? res.data.split("#")[1].split(":")[1] : "-";
|
|
67
|
-
let disliked = likes.includes("-") ? true : false;
|
|
68
|
-
if (desc.includes("/")) desc = desc.split("/")[0];
|
|
69
|
-
if (decB64(desc) == "") desc = "KE5vIGRlc2NyaXB0aW9uIHByb3ZpZGVkKQ==";
|
|
70
|
-
let featured = Boolean(Number(ftrd));
|
|
71
|
-
let difficultyDecoding = {
|
|
72
|
-
"-10": "Auto",
|
|
73
|
-
0: "Unrated",
|
|
74
|
-
10: "Easy",
|
|
75
|
-
20: "Normal",
|
|
76
|
-
30: "Hard",
|
|
77
|
-
40: "Harder",
|
|
78
|
-
50: "Insane"
|
|
79
|
-
};
|
|
80
|
-
if (Boolean(Number(demonBool))) {
|
|
81
|
-
difficultyDecoding = {
|
|
82
|
-
10: "Easy Demon",
|
|
83
|
-
20: "Medium Demon",
|
|
84
|
-
30: "Hard Demon",
|
|
85
|
-
40: "Insane Demon",
|
|
86
|
-
50: "Extreme Demon"
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
const lengthDecoding = {
|
|
90
|
-
0: "Tiny",
|
|
91
|
-
1: "Short",
|
|
92
|
-
2: "Medium",
|
|
93
|
-
3: "Long",
|
|
94
|
-
4: "XL"
|
|
95
|
-
};
|
|
96
|
-
const decodeGameVersion = {
|
|
97
|
-
10: "1.7",
|
|
98
|
-
18: "1.8",
|
|
99
|
-
19: "1.9",
|
|
100
|
-
20: "2.0",
|
|
101
|
-
21: "2.1",
|
|
102
|
-
undefined: "Pre-1.7"
|
|
103
|
-
};
|
|
104
|
-
const {
|
|
105
|
-
getOfficialSongInfo
|
|
106
|
-
} = require("../functions/getOfficialSongInfo.js");
|
|
107
|
-
let song;
|
|
108
|
-
if (Number(officialSong) > 0) song = getOfficialSongInfo(Number(officialSong) + 1);
|
|
109
|
-
if (Number(officialSong) == 0 && Number(customSong) == 0) song = getOfficialSongInfo(1);
|
|
110
|
-
if (Number(customSong) > 0) {
|
|
111
|
-
let songName = l.split("~|~2~|~")[1].split("~|~3~|~")[0];
|
|
112
|
-
let songId = Number(l.split("#1~|~")[1].split("~|~2~|~")[0]);
|
|
113
|
-
let artist = l.split("~|~4~|~")[1].split("~|~5~|~")[0];
|
|
114
|
-
let artistId = Number(l.split("~|~3~|~")[1].split("~|~4~|~")[0]);
|
|
115
|
-
let size = `${l.split("~|~5~|~")[1].split("~|~6~|~")[0]} MB`;
|
|
116
|
-
let link = decodeURIComponent(l.split("~|~10~|~")[1].split("~|~7~|~")[0]);
|
|
117
|
-
song = {
|
|
118
|
-
name: songName,
|
|
119
|
-
id: songId,
|
|
120
|
-
artist: artist,
|
|
121
|
-
artistId: artistId,
|
|
122
|
-
fileSize: size,
|
|
123
|
-
link: link
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
let result = {
|
|
127
|
-
id: Number(id),
|
|
128
|
-
name: name,
|
|
129
|
-
description: decB64(desc),
|
|
130
|
-
creator: author,
|
|
131
|
-
level_version: Number(version),
|
|
132
|
-
difficulty: difficultyDecoding[difficulty],
|
|
133
|
-
stars: Number(stars),
|
|
134
|
-
downloads: Number(downloads),
|
|
135
|
-
likes: Number(likes),
|
|
136
|
-
disliked: disliked,
|
|
137
|
-
length: lengthDecoding[length],
|
|
138
|
-
demon: Boolean(Number(demonBool)),
|
|
139
|
-
featured: featured,
|
|
140
|
-
epic: Boolean(Number(epic)),
|
|
141
|
-
objects: Number(objs),
|
|
142
|
-
stars_requested: Number(starsRequested),
|
|
143
|
-
game_version: decodeGameVersion[gameVersion],
|
|
144
|
-
copied: Number(copiedID),
|
|
145
|
-
large: Number(objs) > 4e4 ? true : false,
|
|
146
|
-
two_p: Boolean(Number(twoPlayer)),
|
|
147
|
-
coins: Number(coins),
|
|
148
|
-
verified_coins: Boolean(Number(verifiedCoins)),
|
|
149
|
-
song: song
|
|
150
|
-
};
|
|
151
|
-
if (["Extreme Demon", "Insane Demon"].includes(difficultyDecoding[difficulty])) {
|
|
152
|
-
const {
|
|
153
|
-
demonlist
|
|
154
|
-
} = require("../misc/demonlist.js");
|
|
155
|
-
const dlist = await demonlist(name.trim());
|
|
156
|
-
if (dlist != null) result.pointercrate = dlist
|
|
157
|
-
}
|
|
158
|
-
return result
|
|
159
|
-
}
|
|
160
|
-
return await decodeLevel(res.data)
|
|
11
|
+
});
|
|
12
|
+
if (res.data == -1) return {};
|
|
13
|
+
return decodeSearchResults(res.data)[0];
|
|
161
14
|
}
|
|
162
15
|
}
|
|
@@ -1,50 +1,67 @@
|
|
|
1
1
|
module.exports = {
|
|
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
|
-
let {decodeScore} = new GJDecode();
|
|
30
|
-
|
|
31
|
-
const data = {
|
|
32
|
-
accountID: user.accountID,
|
|
33
|
-
gjp: gjp(pass),
|
|
34
|
-
levelID: lvl,
|
|
35
|
-
secret: secret,
|
|
36
|
-
type: types[type.toLowerCase()]
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let res = await gjReq("getGJLevelScores211", data);
|
|
40
|
-
|
|
41
|
-
let scores = res.data.split("|");
|
|
42
|
-
let result = [];
|
|
43
|
-
|
|
44
|
-
scores.forEach(s =>{
|
|
45
|
-
result.push(decodeScore(s));
|
|
46
|
-
})
|
|
2
|
+
getLevelScores: async function (lvl, type, user, pass) {
|
|
3
|
+
let types = { week: "2", top: "1", friends: "0" }
|
|
4
|
+
if (!lvl) throw new Error("Please provide a level ID!");
|
|
5
|
+
if (!types[type.toLowerCase()]) throw new Error("Please provide a valid leaderboard type! Possible types: \"week\", \"top\", \"friends\".")
|
|
6
|
+
if (!user) throw new Error("Please provide a username or a Player ID!");
|
|
7
|
+
if (!pass) throw new Error("Please provide a password!");
|
|
8
|
+
|
|
9
|
+
const { gjReq } = require("../gjReq.js");
|
|
10
|
+
const { rgbToHEX } = require("../misc/rgbToHEX");
|
|
11
|
+
const colors = require("../misc/colors.json");
|
|
12
|
+
let search = await gjReq("getGJUsers20", {
|
|
13
|
+
str: user,
|
|
14
|
+
secret: "Wmfd2893gb7"
|
|
15
|
+
});
|
|
16
|
+
if (search.data == -1) return [];
|
|
17
|
+
let accID = search.data.split(":")[21];
|
|
18
|
+
|
|
19
|
+
const XOR = require("../xor.js");
|
|
20
|
+
const xor = new XOR;
|
|
21
|
+
|
|
22
|
+
const data = {
|
|
23
|
+
accountID: accID,
|
|
24
|
+
gjp: xor.encrypt(pass, 37526),
|
|
25
|
+
levelID: lvl,
|
|
26
|
+
secret: "Wmfd2893gb7",
|
|
27
|
+
type: types[type.toLowerCase()]
|
|
28
|
+
}
|
|
47
29
|
|
|
48
|
-
|
|
30
|
+
let res = await gjReq("getGJLevelScores211", data);
|
|
31
|
+
|
|
32
|
+
let scores = res.data.split("|");
|
|
33
|
+
let result = [];
|
|
34
|
+
|
|
35
|
+
let iconObj = {
|
|
36
|
+
0: "cube",
|
|
37
|
+
1: "ship",
|
|
38
|
+
2: "ball",
|
|
39
|
+
3: "ufo",
|
|
40
|
+
4: "wave",
|
|
41
|
+
5: "robot",
|
|
42
|
+
6: "spider",
|
|
43
|
+
7: "swing",
|
|
44
|
+
8: "jetpack"
|
|
49
45
|
}
|
|
46
|
+
|
|
47
|
+
scores.forEach(sc => {
|
|
48
|
+
let s = sc.split(":");
|
|
49
|
+
result.push({
|
|
50
|
+
username: s[1],
|
|
51
|
+
playerID: Number(s[3]),
|
|
52
|
+
accountID: Number(s[15]),
|
|
53
|
+
rank: Number(s[19]),
|
|
54
|
+
c1: rgbToHEX(colors[user[7]]),
|
|
55
|
+
c2: rgbToHEX(colors[user[9]]),
|
|
56
|
+
iconID: Number(s[5]),
|
|
57
|
+
iconType: iconObj[s[11]],
|
|
58
|
+
glow: s[13] == "2" ? true : false,
|
|
59
|
+
percent: Number(s[17]),
|
|
60
|
+
coins: Number(s[21]),
|
|
61
|
+
age: s[23]
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
50
67
|
}
|
package/functions/getMapPacks.js
CHANGED
|
@@ -1,35 +1,47 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
let GJDecode = require("../misc/GJDecode.js");
|
|
9
|
-
const { decodeMapPack } = new GJDecode();
|
|
10
|
-
|
|
11
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
12
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
13
|
-
const data = {
|
|
14
|
-
secret: "Wmfd2893gb7",
|
|
15
|
-
page: Number(page) - 1
|
|
16
|
-
}
|
|
2
|
+
getMapPacks: async function (page = 1) {
|
|
3
|
+
const { gjReq } = require("../gjReq");
|
|
4
|
+
const data = {
|
|
5
|
+
secret: "Wmfd2893gb7",
|
|
6
|
+
page: Number(page) - 1
|
|
7
|
+
}
|
|
17
8
|
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
let res = await gjReq("getGJMapPacks21", data);
|
|
10
|
+
if (res.data.startsWith("#")) throw new Error("-1 Not found.");
|
|
20
11
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
let packs = res.data.split("#")[0].split("|");
|
|
13
|
+
let result = [];
|
|
14
|
+
packs.forEach(p => {
|
|
15
|
+
const { rgbToHEX } = require("../misc/rgbToHEX");
|
|
16
|
+
let diffObj = {
|
|
17
|
+
0: "Auto",
|
|
18
|
+
1: "Easy",
|
|
19
|
+
2: "Normal",
|
|
20
|
+
3: "Hard",
|
|
21
|
+
4: "Harder",
|
|
22
|
+
5: "Insane",
|
|
23
|
+
6: "Hard Demon",
|
|
24
|
+
7: "Easy Demon",
|
|
25
|
+
8: "Medium Demon",
|
|
26
|
+
9: "Insane Demon",
|
|
27
|
+
10: "Extreme Demon"
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
let lvls = [];
|
|
30
|
+
for (let lvl of p.split(":")[5].split(",")) {
|
|
31
|
+
lvls.push(Number(lvl));
|
|
32
|
+
}
|
|
33
|
+
result.push({
|
|
34
|
+
name: p.split(":")[3],
|
|
35
|
+
id: Number(p.split(":")[1]),
|
|
36
|
+
levels: lvls,
|
|
37
|
+
stars: Number(p.split(":")[7]),
|
|
38
|
+
coins: Number(p.split(":")[9]),
|
|
39
|
+
difficulty: diffObj[p.split(":")[11]],
|
|
40
|
+
textColor: rgbToHEX(p.split(":")[13]),
|
|
41
|
+
barColor: rgbToHEX(p.split(":")[15])
|
|
31
42
|
})
|
|
43
|
+
})
|
|
32
44
|
|
|
33
|
-
|
|
34
|
-
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
35
47
|
}
|
package/functions/getMessages.js
CHANGED
|
@@ -1,48 +1,43 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {*} page - The page.
|
|
7
|
-
*/
|
|
8
|
-
getMessages:
|
|
9
|
-
async function(user, pass, page = 1) {
|
|
10
|
-
if(!user) throw new Error("Please provide your player ID or username!");
|
|
11
|
-
if(!pass) throw new Error("Please provide your password!");
|
|
12
|
-
if(Number(page) == NaN) throw new Error("The page should be a number!");
|
|
13
|
-
|
|
14
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
15
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
16
|
-
const {secret} = require("../config.json");
|
|
17
|
-
const {gjp} = require("../misc/gjp.js");
|
|
18
|
-
let GJDecode = require("../misc/GJDecode.js");
|
|
19
|
-
const {decMsg} = new GJDecode();
|
|
20
|
-
const { searchUsers } = require("./searchUsers.js");
|
|
2
|
+
getMessages: async function (user, pass, page = 1) {
|
|
3
|
+
if (!user) throw new Error("Please provide a player ID or username!");
|
|
4
|
+
if (!pass) throw new Error("Please provide a password!");
|
|
5
|
+
if (isNaN(page)) throw new Error("The page should be a number!");
|
|
21
6
|
|
|
22
|
-
|
|
7
|
+
const { gjReq } = require("../gjReq");
|
|
8
|
+
const XOR = require("../xor");
|
|
9
|
+
const xor = new XOR;
|
|
23
10
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
let search = await gjReq("getGJUsers20", {
|
|
12
|
+
str: user,
|
|
13
|
+
secret: "Wmfd2893gb7"
|
|
14
|
+
});
|
|
15
|
+
if (search.data == -1) return [];
|
|
16
|
+
let accID = search.data.split(":")[21];
|
|
30
17
|
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
let res = await gjReq("getGJMessages20", {
|
|
19
|
+
accountID: accID,
|
|
20
|
+
gjp: xor.encrypt(pass, 37526),
|
|
21
|
+
secret: "Wmfd2893gb7",
|
|
22
|
+
page: page - 1
|
|
23
|
+
});
|
|
24
|
+
if (res.data == -1 || res.data.startsWith("#")) return [];
|
|
33
25
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
let msgs = res.data.split("#")[0].split("|");
|
|
27
|
+
let result = [];
|
|
28
|
+
msgs.forEach(m => {
|
|
29
|
+
let s = m.split(":");
|
|
30
|
+
result.push({
|
|
31
|
+
username: s[1],
|
|
32
|
+
title: Buffer.from(s[9], "base64").toString(),
|
|
33
|
+
playerID: Number(s[3]),
|
|
34
|
+
accountID: Number(s[5]),
|
|
35
|
+
messageID: Number(s[7]),
|
|
36
|
+
age: s[15],
|
|
37
|
+
read: Boolean(Number(s[11]))
|
|
38
|
+
});
|
|
39
|
+
})
|
|
39
40
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
msgs.forEach(m => {
|
|
43
|
-
result.push(decMsg(m));
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
48
43
|
}
|
|
@@ -1,89 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
sm,
|
|
12
|
-
bot,
|
|
13
|
-
pg,
|
|
14
|
-
dout,
|
|
15
|
-
bab,
|
|
16
|
-
clg,
|
|
17
|
-
j,
|
|
18
|
-
tm,
|
|
19
|
-
c,
|
|
20
|
-
xs,
|
|
21
|
-
cf,
|
|
22
|
-
toe,
|
|
23
|
-
ea,
|
|
24
|
-
cs,
|
|
25
|
-
ed,
|
|
26
|
-
hf,
|
|
27
|
-
bp,
|
|
28
|
-
toeii,
|
|
29
|
-
gd,
|
|
30
|
-
d,
|
|
31
|
-
fd,
|
|
32
|
-
tss,
|
|
33
|
-
va,
|
|
34
|
-
ar,
|
|
35
|
-
tc,
|
|
36
|
-
p,
|
|
37
|
-
bm,
|
|
38
|
-
m,
|
|
39
|
-
y,
|
|
40
|
-
f,
|
|
41
|
-
sp,
|
|
42
|
-
s,
|
|
43
|
-
e,
|
|
44
|
-
round,
|
|
45
|
-
mdo,
|
|
46
|
-
unknown
|
|
47
|
-
} = require("../misc/officialsongs.json");
|
|
48
|
-
const jsons = {
|
|
49
|
-
1: sm,
|
|
50
|
-
2: bot,
|
|
51
|
-
3: pg,
|
|
52
|
-
4: dout,
|
|
53
|
-
5: bab,
|
|
54
|
-
6: clg,
|
|
55
|
-
7: j,
|
|
56
|
-
8: tm,
|
|
57
|
-
9: c,
|
|
58
|
-
10: xs,
|
|
59
|
-
11: cf,
|
|
60
|
-
12: toe,
|
|
61
|
-
13: ea,
|
|
62
|
-
14: cs,
|
|
63
|
-
15: ed,
|
|
64
|
-
16: hf,
|
|
65
|
-
17: bp,
|
|
66
|
-
18: toeii,
|
|
67
|
-
19: gd,
|
|
68
|
-
20: d,
|
|
69
|
-
21: fd,
|
|
70
|
-
22: tss,
|
|
71
|
-
23: va,
|
|
72
|
-
24: ar,
|
|
73
|
-
25: tc,
|
|
74
|
-
26: p,
|
|
75
|
-
27: bm,
|
|
76
|
-
28: m,
|
|
77
|
-
29: y,
|
|
78
|
-
30: f,
|
|
79
|
-
31: sp,
|
|
80
|
-
32: s,
|
|
81
|
-
33: e,
|
|
82
|
-
34: round,
|
|
83
|
-
35: mdo
|
|
84
|
-
}
|
|
85
|
-
let result = jsons[Number(song)];
|
|
86
|
-
if(result == undefined) result = unknown;
|
|
87
|
-
return result;
|
|
88
|
-
}
|
|
2
|
+
getOfficialSongInfo: function (song) {
|
|
3
|
+
if (isNaN(song)) throw new Error("Please provide a valid official song ID.");
|
|
4
|
+
const { sm, bot, pg, dout, bab, clg, j, tm, c, xs, cf, toe, ea, cs, ed, hf, bp, toeii, gd, d, fd, dash, exp, tss, va, ar, tc, p, bm, m, y, f, sp, s, e, round, mdo, ps, ne, pt, unknown } = require("../misc/officialsongs.json");
|
|
5
|
+
const jsons = { 1: sm, 2: bot, 3: pg, 4: dout, 5: bab, 6: clg, 7: j, 8: tm, 9: c, 10: xs, 11: cf, 12: toe, 13: ea, 14: cs, 15: ed, 16: hf, 17: bp, 18: toeii, 19: gd, 20: d, 21: fd, 22: dash, 23: exp, 24: tss, 25: va, 26: ar, 27: tc, 28: p, 29: bm, 30: m, 31: y, 32: f, 33: sp, 34: s, 35: e, 36: round, 37: mdo, 38: ps, 39: ne, 40: pt };
|
|
6
|
+
|
|
7
|
+
let result = jsons[Number(song)];
|
|
8
|
+
if (!result) result = unknown;
|
|
9
|
+
return result;
|
|
10
|
+
}
|
|
89
11
|
}
|