gj-boomlings-api 1.5.7 → 2.0.0
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 +1 -8
- 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 +1 -7
- package/functions/getSongInfo.js +22 -31
- package/functions/getSongsLibrary.js +1 -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 +1 -0
- package/index.js +2 -1
- package/misc/GJDecode.js +1 -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/xor.js +1 -0
- 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 +0 -5
|
@@ -1,47 +1,67 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {*} mode - The mode of fetching the history. `0` is for recent, `1` is for most liked.
|
|
7
|
-
*/
|
|
8
|
-
getCommentHistory:
|
|
9
|
-
async function(str, page = 1, mode = 1) {
|
|
10
|
-
if(!str) throw new Error("Please provide a player ID or name!");
|
|
11
|
-
if(page && isNaN(page)) throw new Error("Please provide a page!");
|
|
12
|
-
if(mode && isNaN(mode)) throw new Error("Please provide a valid mode ID! 0 for recent, 1 for most liked.");
|
|
2
|
+
getCommentHistory: async function (str, page = 1, mode = 1) {
|
|
3
|
+
if (!str) throw new Error("Please provide a player ID or name!");
|
|
4
|
+
if (page && isNaN(page)) throw new Error("Please provide a page!");
|
|
5
|
+
if (mode && isNaN(mode)) throw new Error("Please provide a valid mode ID! 0 for recent, 1 for most liked.");
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const {getProfile} = require("./getProfile.js");
|
|
19
|
-
|
|
20
|
-
const user = await getProfile(str);
|
|
21
|
-
if(user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!");
|
|
7
|
+
const { gjReq } = require("../gjReq.js");
|
|
8
|
+
const { getProfile } = require("./getProfile.js");
|
|
9
|
+
const { rgbToHEX } = require("../misc/rgbToHEX");
|
|
10
|
+
const colors = require("../misc/colors.json");
|
|
22
11
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
userID: user.playerID,
|
|
26
|
-
page: Number(page) - 1,
|
|
27
|
-
mode: Number(mode)
|
|
28
|
-
}
|
|
12
|
+
const user = await getProfile(str);
|
|
13
|
+
if (user.commentHistory != "all") throw new Error("Whoops! This user has disabled viewing his comment history!");
|
|
29
14
|
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
let res = await gjReq("getGJCommentHistory", {
|
|
16
|
+
secret: "Wmfd2893gb7",
|
|
17
|
+
userID: user.playerID,
|
|
18
|
+
page: Number(page) - 1,
|
|
19
|
+
mode: Number(mode)
|
|
20
|
+
});
|
|
21
|
+
if (res.data == -1) return [];
|
|
32
22
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
36
|
-
return res.data;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
let comments = res.data.split("|");
|
|
40
|
-
let result = [];
|
|
41
|
-
comments.forEach(c => {
|
|
42
|
-
result.push(decCommentFromHistory(c));
|
|
43
|
-
})
|
|
23
|
+
let comments = res.data.split("#")[0].split("|");
|
|
24
|
+
let result = [];
|
|
44
25
|
|
|
45
|
-
|
|
26
|
+
let iconObj = {
|
|
27
|
+
0: "cube",
|
|
28
|
+
1: "ship",
|
|
29
|
+
2: "ball",
|
|
30
|
+
3: "ufo",
|
|
31
|
+
4: "wave",
|
|
32
|
+
5: "robot",
|
|
33
|
+
6: "spider",
|
|
34
|
+
7: "swing",
|
|
35
|
+
8: "jetpack"
|
|
46
36
|
}
|
|
37
|
+
|
|
38
|
+
comments.forEach(c => {
|
|
39
|
+
let comment = c.split(":")[0].split("~");
|
|
40
|
+
let user = c.split(":")[1].split("~");
|
|
41
|
+
let obj = {
|
|
42
|
+
levelID: Number(comment[3]),
|
|
43
|
+
content: Buffer.from(comment[1], "base64").toString(),
|
|
44
|
+
likes: Number(comment[7]),
|
|
45
|
+
disliked: comment[7] < 0 ? true : false,
|
|
46
|
+
percent: Number(comment[9]),
|
|
47
|
+
id: Number(comment[13]),
|
|
48
|
+
age: comment[11],
|
|
49
|
+
username: user[1],
|
|
50
|
+
iconID: Number(user[3]),
|
|
51
|
+
c1: rgbToHEX(colors[user[5]]),
|
|
52
|
+
c2: rgbToHEX(colors[user[7]]),
|
|
53
|
+
iconType: iconObj[user[9]],
|
|
54
|
+
glow: Boolean(Number(user[11])),
|
|
55
|
+
playerID: Number(comment[5]),
|
|
56
|
+
accountID: Number(user[13])
|
|
57
|
+
};
|
|
58
|
+
if (comment.length > 14) {
|
|
59
|
+
obj.mod = comment[15] == "1" ? "mod" : "elder";
|
|
60
|
+
obj.color = rgbToHEX(comment[17]);
|
|
61
|
+
}
|
|
62
|
+
result.push(obj);
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
47
67
|
}
|
package/functions/getComments.js
CHANGED
|
@@ -1,41 +1,60 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
/**
|
|
3
|
-
* Gets the comments from a specified level.
|
|
4
|
-
* @param {*} level - The level ID to get the comments from.
|
|
5
|
-
* @param {*} page - The page.
|
|
6
|
-
* @param {*} mode - The mode of fetching the comments. `0` is for recent, `1` is for most liked.
|
|
7
|
-
*/
|
|
8
2
|
getComments:
|
|
9
|
-
async function(level, page = 1, mode = 1) {
|
|
10
|
-
if(
|
|
11
|
-
if(isNaN(
|
|
12
|
-
if(mode && isNaN(mode)) throw new Error("Please provide a mode ID! 0 for recent, 1 for most liked.");
|
|
3
|
+
async function (level, page = 1, mode = 1) {
|
|
4
|
+
if (isNaN(level)) throw new Error("Please provide a valid level ID!");
|
|
5
|
+
if (mode && isNaN(mode)) throw new Error("Please provide a mode ID! 0 for recent, 1 for most liked.");
|
|
13
6
|
|
|
14
|
-
const {gjReq} = require("../
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
const { decodeGJComment } = new GJDecode();
|
|
7
|
+
const { gjReq } = require("../gjReq");
|
|
8
|
+
const { rgbToHEX } = require("../misc/rgbToHEX");
|
|
9
|
+
const colors = require("../misc/colors.json");
|
|
18
10
|
|
|
19
|
-
|
|
11
|
+
let res = await gjReq("getGJComments21", {
|
|
20
12
|
levelID: level,
|
|
21
13
|
page: Number(page) - 1,
|
|
22
14
|
mode: Number(mode),
|
|
23
|
-
secret: "Wmfd2893gb7"
|
|
24
|
-
}
|
|
15
|
+
secret: "Wmfd2893gb7"
|
|
16
|
+
});
|
|
17
|
+
if (res.data == -1 || res.data.startsWith("#")) return [];
|
|
25
18
|
|
|
26
|
-
let
|
|
27
|
-
|
|
19
|
+
let comments = res.data.split("#")[0].split("|");
|
|
20
|
+
let result = [];
|
|
28
21
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
let iconObj = {
|
|
23
|
+
0: "cube",
|
|
24
|
+
1: "ship",
|
|
25
|
+
2: "ball",
|
|
26
|
+
3: "ufo",
|
|
27
|
+
4: "wave",
|
|
28
|
+
5: "robot",
|
|
29
|
+
6: "spider",
|
|
30
|
+
7: "swing",
|
|
31
|
+
8: "jetpack"
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
let comments = res.data.split("|");
|
|
36
|
-
let result = [];
|
|
33
|
+
|
|
37
34
|
comments.forEach(c => {
|
|
38
|
-
|
|
35
|
+
let comment = c.split(":")[0].split("~");
|
|
36
|
+
let user = c.split(":")[1].split("~");
|
|
37
|
+
let obj = {
|
|
38
|
+
content: Buffer.from(comment[1], "base64").toString(),
|
|
39
|
+
playerID: Number(comment[3]),
|
|
40
|
+
likes: Number(comment[5]),
|
|
41
|
+
disliked: comment[5] < 0 ? true : false,
|
|
42
|
+
percent: Number(comment[9]),
|
|
43
|
+
id: Number(comment[13]),
|
|
44
|
+
age: comment[11],
|
|
45
|
+
username: user[1],
|
|
46
|
+
iconID: Number(user[3]),
|
|
47
|
+
c1: rgbToHEX(colors[user[5]]),
|
|
48
|
+
c2: rgbToHEX(colors[user[7]]),
|
|
49
|
+
iconType: iconObj[user[9]],
|
|
50
|
+
glow: Boolean(Number(user[11])),
|
|
51
|
+
accountID: Number(user[13])
|
|
52
|
+
};
|
|
53
|
+
if (comment.length > 14) {
|
|
54
|
+
obj.mod = comment[15] == "1" ? "mod" : "elder";
|
|
55
|
+
obj.color = rgbToHEX(comment[17]);
|
|
56
|
+
}
|
|
57
|
+
result.push(obj);
|
|
39
58
|
})
|
|
40
59
|
|
|
41
60
|
return result;
|
|
@@ -1,37 +1,25 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
async function() {
|
|
7
|
-
let GJDecode = require("../misc/GJDecode.js");
|
|
8
|
-
const { decScoresUser } = new GJDecode();
|
|
9
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
10
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
11
|
-
const { secret } = require("../config.json");
|
|
2
|
+
getCreatorScores: async function () {
|
|
3
|
+
let GJDecode = require("../misc/GJDecode");
|
|
4
|
+
const { decodeScoresUser } = new GJDecode;
|
|
5
|
+
const { gjReq } = require("../gjReq");
|
|
12
6
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
let res = await gjReq("getGJScores20", data);
|
|
20
|
-
if(res.data == "error code: 1005") {
|
|
21
|
-
res = await gjWReq("getCreatorScores");
|
|
22
|
-
return res.data;
|
|
23
|
-
}
|
|
7
|
+
const data = {
|
|
8
|
+
secret: "Wmfd2893gb7",
|
|
9
|
+
type: "creators",
|
|
10
|
+
count: 100
|
|
11
|
+
}
|
|
24
12
|
|
|
25
|
-
|
|
26
|
-
let emptyElem = players[100];
|
|
13
|
+
let res = await gjReq("getGJScores20", data);
|
|
27
14
|
|
|
28
|
-
|
|
15
|
+
let players = res.data.split("|");
|
|
16
|
+
players.pop();
|
|
29
17
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
let result = [];
|
|
19
|
+
players.forEach(p => {
|
|
20
|
+
result.push(decodeScoresUser(p));
|
|
21
|
+
});
|
|
34
22
|
|
|
35
|
-
|
|
36
|
-
|
|
23
|
+
return result;
|
|
24
|
+
}
|
|
37
25
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { dlLevel } = require("./dlLevel.js")
|
|
8
|
-
let res = await dlLevel(-1);
|
|
9
|
-
return res;
|
|
10
|
-
}
|
|
2
|
+
getDailyLevel: async function () {
|
|
3
|
+
const { dlLevel } = require("./dlLevel")
|
|
4
|
+
let res = await dlLevel(-1);
|
|
5
|
+
return res;
|
|
6
|
+
}
|
|
11
7
|
}
|
|
@@ -1,67 +1,59 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
getFriendsList: async function (user, pass) {
|
|
3
|
+
if (!user) throw new Error("Please provide a player ID or username!");
|
|
4
|
+
if (!pass) throw new Error("Please provide a password!");
|
|
5
|
+
|
|
6
|
+
const { gjReq } = require("../gjReq");
|
|
7
|
+
const XOR = require("../xor");
|
|
8
|
+
const xor = new XOR;
|
|
9
|
+
|
|
10
|
+
let search = await gjReq("getGJUsers20", {
|
|
11
|
+
str: user,
|
|
12
|
+
secret: "Wmfd2893gb7"
|
|
13
|
+
});
|
|
14
|
+
if (search.data == -1) return [];
|
|
15
|
+
let accID = search.data.split(":")[21];
|
|
16
|
+
|
|
17
|
+
const data = {
|
|
18
|
+
accountID: accID,
|
|
19
|
+
gjp: xor.encrypt(pass, 37526),
|
|
20
|
+
secret: "Wmfd2893gb7"
|
|
21
|
+
}
|
|
11
22
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const {gjp} = require("../misc/gjp.js");
|
|
15
|
-
const { searchUsers } = require("./searchUsers.js");
|
|
23
|
+
let res = await gjReq("getGJUserList20", data);
|
|
24
|
+
if (res.data == -1 || res.data == -2) return [];
|
|
16
25
|
|
|
17
|
-
|
|
26
|
+
let players = res.data.split("|");
|
|
27
|
+
let result = [];
|
|
18
28
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
gjp: gjp(pass),
|
|
22
|
-
secret: "Wmfd2893gb7"
|
|
23
|
-
}
|
|
29
|
+
let colors = require("../misc/colors.json");
|
|
30
|
+
const { rgbToHEX } = require("../misc/rgbToHEX");
|
|
24
31
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
32
|
+
players.forEach(p => {
|
|
33
|
+
let s=p.split(":");
|
|
34
|
+
let username = s[1];
|
|
35
|
+
let playerID = s[3];
|
|
36
|
+
let p1 = s[7];
|
|
37
|
+
let p2 = s[9];
|
|
38
|
+
let accID = s[15];
|
|
39
|
+
let msg = s[17];
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
let msgObj = {
|
|
42
|
+
"0": "all",
|
|
43
|
+
"1": "friends",
|
|
44
|
+
"2": "none"
|
|
33
45
|
}
|
|
34
|
-
|
|
35
|
-
let players = res.data.split("|");
|
|
36
|
-
let result = [];
|
|
37
|
-
|
|
38
|
-
let colors = require("../misc/colors.json");
|
|
39
|
-
const { rgbToHEX } = require("../misc/rgbToHEX.js");
|
|
40
46
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
let msgState = {
|
|
50
|
-
"0": "all",
|
|
51
|
-
"1": "friends",
|
|
52
|
-
"2": "none"
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
result.push({
|
|
56
|
-
username: username,
|
|
57
|
-
playerID: Number(playerID),
|
|
58
|
-
accountID: Number(accID),
|
|
59
|
-
color1: rgbToHEX(colors[p1]),
|
|
60
|
-
color2: rgbToHEX(colors[p2]),
|
|
61
|
-
messages: msgState[msg]
|
|
62
|
-
})
|
|
47
|
+
result.push({
|
|
48
|
+
username: username,
|
|
49
|
+
playerID: Number(playerID),
|
|
50
|
+
accountID: Number(accID),
|
|
51
|
+
color1: rgbToHEX(colors[p1]),
|
|
52
|
+
color2: rgbToHEX(colors[p2]),
|
|
53
|
+
messages: msgObj[msg]
|
|
63
54
|
})
|
|
55
|
+
})
|
|
64
56
|
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
67
59
|
}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
getGauntlets:
|
|
6
|
-
async function() {
|
|
7
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
8
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
9
|
-
let GJDecode = require("../misc/GJDecode.js");
|
|
10
|
-
const { decodeGJGauntlet } = new GJDecode();
|
|
2
|
+
getGauntlets: async function () {
|
|
3
|
+
const glIDs = require("../misc/gauntlets.json");
|
|
4
|
+
const { gjReq } = require("../gjReq");
|
|
11
5
|
|
|
12
|
-
|
|
13
|
-
secret: "Wmfd2893gb7"
|
|
14
|
-
}
|
|
6
|
+
let res = await gjReq("getGJGauntlets21", { secret: "Wmfd2893gb7", special: 1 })
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
8
|
+
let gauntlets = res.data.split("#")[0].split("|");
|
|
9
|
+
let result = [];
|
|
10
|
+
gauntlets.forEach(g => {
|
|
11
|
+
let arr = g.split(":")[3].split(",");
|
|
12
|
+
let list = [];
|
|
13
|
+
for (let level of arr) {
|
|
14
|
+
list.push(Number(level));
|
|
20
15
|
}
|
|
16
|
+
result.push({
|
|
17
|
+
name: `${glIDs[g.split(":")[1]]} Gauntlet`,
|
|
18
|
+
levels: list
|
|
19
|
+
});
|
|
20
|
+
})
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
gauntlets.forEach(g => {
|
|
25
|
-
result.push(decodeGJGauntlet(g));
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
return result;
|
|
29
|
-
}
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
30
24
|
}
|
|
@@ -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
|
}
|