gj-boomlings-api 1.4.5 → 1.5.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/config.json +1 -10
- package/functions/blockUser.js +8 -2
- package/functions/deleteAccountPost.js +8 -2
- package/functions/deleteLevel.js +7 -1
- package/functions/dlLevel.js +5 -1
- package/functions/dlMessage.js +9 -2
- package/functions/getAccountPosts.js +8 -2
- package/functions/getBlockedList.js +6 -1
- package/functions/getCommentHistory.js +10 -3
- package/functions/getComments.js +9 -2
- package/functions/getCreatorScores.js +6 -2
- package/functions/getDailyLevel.js +3 -0
- package/functions/getFriendsList.js +6 -1
- package/functions/getGauntlets.js +6 -2
- package/functions/getLevelByID.js +153 -10
- package/functions/getLevelScores.js +50 -0
- package/functions/getMapPacks.js +5 -1
- package/functions/getMessages.js +7 -1
- package/functions/getOfficialSongInfo.js +4 -0
- package/functions/getProfile.js +5 -1
- package/functions/getSongInfo.js +5 -1
- package/functions/getTab.js +95 -0
- package/functions/getTop100.js +4 -1
- package/functions/getUserLevels.js +6 -1
- package/functions/getWeeklyDemon.js +5 -2
- package/functions/reportLevel.js +7 -1
- package/functions/searchLevels.js +6 -1
- package/functions/searchUsers.js +5 -1
- package/functions/unblockUser.js +7 -1
- package/functions/updateLevelDesc.js +8 -1
- package/functions/uploadAccountPost.js +7 -1
- package/functions/uploadComment.js +22 -14
- package/functions/uploadMessage.js +9 -1
- package/index.js +1 -65
- package/misc/GJDecode.js +1 -0
- package/misc/colors.json +1 -44
- package/misc/decB64.js +1 -2
- package/misc/encB64.js +1 -3
- package/misc/officialsongs.json +1 -216
- package/misc/rgbToHEX.js +1 -0
- package/package.json +4 -1
- package/misc/decCommentFromHistory.js +0 -38
- package/misc/decMessage.js +0 -34
- package/misc/decMsg.js +0 -30
- package/misc/decScoresUser.js +0 -45
- package/misc/decodeAccountPost.js +0 -23
- package/misc/decodeGJComment.js +0 -36
- package/misc/decodeGJGauntlet.js +0 -43
- package/misc/decodeLevel.js +0 -144
- package/misc/decodeLevelRes.js +0 -118
- package/misc/decodeMapPack.js +0 -54
- package/misc/decodeUserResult.js +0 -41
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Gets the levels in a specified tab. Possible tabs: `"trending"`, `"recent"`, `"featured"`, `"magic"`, `"awarded"`, `"epic"`.
|
|
4
|
+
* @param {*} tab - The tab to get levels from.
|
|
5
|
+
* @param {*} page - The page.
|
|
6
|
+
*/
|
|
7
|
+
getTab:
|
|
8
|
+
async function(tab, page = 1) {
|
|
9
|
+
let validTabs = {
|
|
10
|
+
"trending": 3,
|
|
11
|
+
"recent": 4,
|
|
12
|
+
"featured": 6,
|
|
13
|
+
"magic": 7,
|
|
14
|
+
"awarded": 11,
|
|
15
|
+
"epic": 16,
|
|
16
|
+
"hall of fame": 16
|
|
17
|
+
}
|
|
18
|
+
if(!validTabs[tab.toLowerCase()]) throw new Error('Please provide a valid tab! Possible tabs: "trending", "recent", "featured", "magic", "awarded", "epic".')
|
|
19
|
+
|
|
20
|
+
const {gjReq} = require("../misc/gjReq.js");
|
|
21
|
+
const {gjWReq} = require("../misc/gjWReq.js");
|
|
22
|
+
const { secret } = require("../config.json");
|
|
23
|
+
|
|
24
|
+
const { decodeLevelRes } = require("../misc/decodeLevelRes.js");
|
|
25
|
+
|
|
26
|
+
const data = {
|
|
27
|
+
type: validTabs[tab.toLowerCase()],
|
|
28
|
+
page: Number(page) - 1,
|
|
29
|
+
secret: secret
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
let res = await gjReq("getGJLevels21", data);
|
|
33
|
+
|
|
34
|
+
if(res.data == "error code: 1005") {
|
|
35
|
+
res = await gjWReq("getTab", `${tab}?page=${page}`);
|
|
36
|
+
if(res.status == 403) throw new Error(res.data.error);
|
|
37
|
+
return res.data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
let levels = res.data.split("#")[0].split("|");
|
|
41
|
+
let creators = res.data.split("#")[1].split("|");
|
|
42
|
+
let songs = res.data.split("#")[2].split(":");
|
|
43
|
+
|
|
44
|
+
let result = [];
|
|
45
|
+
|
|
46
|
+
let encCreators = {};
|
|
47
|
+
let encSongs = {};
|
|
48
|
+
|
|
49
|
+
creators.forEach(c => {
|
|
50
|
+
let playerID = c.split(":")[0];
|
|
51
|
+
let username = c.split(":")[1];
|
|
52
|
+
encCreators[playerID] = username;
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
songs.forEach(s => {
|
|
56
|
+
let songId = s.split("~|~")[1];
|
|
57
|
+
let songName = s.split("~|~")[3];
|
|
58
|
+
let songArtistID = s.split("~|~")[5];
|
|
59
|
+
let songArtist = s.split("~|~")[7];
|
|
60
|
+
let size = s.split("~|~")[9];
|
|
61
|
+
let link = s.split("~|~")[13];
|
|
62
|
+
|
|
63
|
+
encSongs[songId] = {
|
|
64
|
+
"name": songName,
|
|
65
|
+
"id": Number(songId),
|
|
66
|
+
"artist": songArtist,
|
|
67
|
+
"artistId": Number(songArtistID),
|
|
68
|
+
"fileSize": `${size} MB`,
|
|
69
|
+
"link": decodeURIComponent(link)
|
|
70
|
+
};
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
for(const l of levels) {
|
|
74
|
+
let decLvl = decodeLevelRes(l);
|
|
75
|
+
const { getOfficialSongInfo } = require("./getOfficialSongInfo.js");
|
|
76
|
+
|
|
77
|
+
let lvl = decLvl.res;
|
|
78
|
+
let officialSongID = Number(decLvl.officialSong);
|
|
79
|
+
let songID = Number(decLvl.customSong);
|
|
80
|
+
let playerId = decLvl.playerID;
|
|
81
|
+
let song;
|
|
82
|
+
|
|
83
|
+
if(officialSongID == 0 && songID != 0 || officialSongID != 0 && songID != 0) song = encSongs[songID.toString()];
|
|
84
|
+
if(officialSongID != 0 && songID == 0) song = getOfficialSongInfo(officialSongID + 1);
|
|
85
|
+
if(officialSongID == 0 && songID == 0) song = getOfficialSongInfo(1);
|
|
86
|
+
|
|
87
|
+
lvl['creator'] = encCreators[playerId] != undefined ? encCreators[playerId] : "-";
|
|
88
|
+
lvl['song'] = song;
|
|
89
|
+
|
|
90
|
+
result.push(lvl);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
95
|
+
}
|
package/functions/getTop100.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Gets the top 100 players.
|
|
4
|
+
*/
|
|
2
5
|
getTop100:
|
|
3
6
|
async function() {
|
|
4
7
|
const { decScoresUser } = require("../misc/decScoresUser.js");
|
|
@@ -13,7 +16,7 @@ module.exports = {
|
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
let res = await gjReq("getGJScores20", data);
|
|
16
|
-
if(res.data
|
|
19
|
+
if(res.data == "error code: 1005") res = await gjWReq("getTop100");
|
|
17
20
|
|
|
18
21
|
let players = res.data.split("|");
|
|
19
22
|
let emptyElem = players.indexOf(100);
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Gets the levels by a specified user.
|
|
4
|
+
* @param str - The username or player ID of a user to get levels by.
|
|
5
|
+
* @param page - The page.
|
|
6
|
+
*/
|
|
2
7
|
getUserLevels:
|
|
3
8
|
async function(str, page = 1) {
|
|
4
9
|
if(!str) throw new Error("Please provide a username or player ID!");
|
|
@@ -21,7 +26,7 @@ module.exports = {
|
|
|
21
26
|
|
|
22
27
|
let res = await gjReq("getGJLevels21", data);
|
|
23
28
|
|
|
24
|
-
if(res.data
|
|
29
|
+
if(res.data == "error code: 1005") {
|
|
25
30
|
res = await gjWReq("getUserLevels", `${str}?page=${page}`);
|
|
26
31
|
if(res.status == 403) throw new Error(res.data.error);
|
|
27
32
|
return res.data;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Gets the current weekly demon.
|
|
4
|
+
*/
|
|
2
5
|
getWeeklyDemon:
|
|
3
|
-
async function() {
|
|
4
|
-
const { dlLevel } = require("./dlLevel.js")
|
|
6
|
+
async function () {
|
|
7
|
+
const { dlLevel } = require("./dlLevel.js");
|
|
5
8
|
let res = await dlLevel(-2);
|
|
6
9
|
return res;
|
|
7
10
|
}
|
package/functions/reportLevel.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Reports the level.
|
|
4
|
+
*
|
|
5
|
+
* Always returns 1, regardless of whether the level exists or not.
|
|
6
|
+
* @param {*} level - The level to report.
|
|
7
|
+
*/
|
|
2
8
|
reportLevel:
|
|
3
9
|
async function(level) {
|
|
4
10
|
if(!level) throw new Error("Please provide a level ID.");
|
|
@@ -13,7 +19,7 @@ module.exports = {
|
|
|
13
19
|
}
|
|
14
20
|
|
|
15
21
|
let res = await gjReq("reportGJLevel", data);
|
|
16
|
-
if(res.data
|
|
22
|
+
if(res.data == "error code: 1005") res = await gjWReq("reportLevel", id);
|
|
17
23
|
|
|
18
24
|
return res.data;
|
|
19
25
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Searches for levels.
|
|
4
|
+
* @param {*} query - The search query.
|
|
5
|
+
* @param {*} page - The page.
|
|
6
|
+
*/
|
|
2
7
|
searchLevels:
|
|
3
8
|
async function(query, page = 1) {
|
|
4
9
|
const {gjReq} = require("../misc/gjReq.js");
|
|
@@ -16,7 +21,7 @@ module.exports = {
|
|
|
16
21
|
|
|
17
22
|
let res = await gjReq("getGJLevels21", data)
|
|
18
23
|
|
|
19
|
-
if(res.data
|
|
24
|
+
if(res.data == "error code: 1005") {
|
|
20
25
|
res = await gjWReq("searchLevels", `${query}?page=${page}`);
|
|
21
26
|
if(res.status == 403) throw new Error(res.data.error);
|
|
22
27
|
return res.data;
|
package/functions/searchUsers.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Searches for users.
|
|
4
|
+
* @param {*} str - The search query.
|
|
5
|
+
*/
|
|
2
6
|
searchUsers:
|
|
3
7
|
async function(str) {
|
|
4
8
|
if(!str) throw new Error("Please provide a query!");
|
|
@@ -12,7 +16,7 @@ module.exports = {
|
|
|
12
16
|
})
|
|
13
17
|
|
|
14
18
|
if(res.data == -1) throw new Error(`Couldn't find a "${str}" user.`);
|
|
15
|
-
if(res.data
|
|
19
|
+
if(res.data == "error code: 1005") {
|
|
16
20
|
res = await gjWReq("searchUsers", str);
|
|
17
21
|
if(res.status == 403) throw new Error(res.data.error);
|
|
18
22
|
}
|
package/functions/unblockUser.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Unblocks the blocked user.
|
|
4
|
+
* @param {*} target - The user to unblock.
|
|
5
|
+
* @param {*} username - The unblocking person's player ID or username.
|
|
6
|
+
* @param {*} password - The unblocking person's password.
|
|
7
|
+
*/
|
|
2
8
|
unblockUser:
|
|
3
9
|
async function(target, username, password) {
|
|
4
10
|
if(!target) throw new Error("Please provide a target's player ID or username!");
|
|
@@ -24,7 +30,7 @@ module.exports = {
|
|
|
24
30
|
let res = await gjReq("unblockGJUser20", data)
|
|
25
31
|
if(res.data == -1) throw new Error(-1);
|
|
26
32
|
|
|
27
|
-
if(res.data
|
|
33
|
+
if(res.data == "error code: 1005") res = await gjWReq("unblockUser", `${target}?user=${username}&password=${password}`);
|
|
28
34
|
if(res.status == 403) throw new Error(res.data.error);
|
|
29
35
|
|
|
30
36
|
return 1;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Updates the level description.
|
|
4
|
+
* @param {*} level - The level ID.
|
|
5
|
+
* @param {*} d - The level's new description.
|
|
6
|
+
* @param {*} user - The level creator's player ID or name.
|
|
7
|
+
* @param {*} password - The level creator's password.
|
|
8
|
+
*/
|
|
2
9
|
updateLevelDesc:
|
|
3
10
|
async function(level, d, user, password) {
|
|
4
11
|
let desc = d;
|
|
@@ -30,7 +37,7 @@ module.exports = {
|
|
|
30
37
|
let res = await gjReq("updateGJDesc20", uLDdata);
|
|
31
38
|
if(res.data == -1) throw new Error("-1 Failed to update the description.");
|
|
32
39
|
|
|
33
|
-
if(res.data
|
|
40
|
+
if(res.data == "error code: 1005") res = await gjWReq("updateLevelDesc", `${level}?content=${encB64(desc)}&user=${user}&password=${password}`);
|
|
34
41
|
if(res.status == 403) throw new Error(res.data.error);
|
|
35
42
|
|
|
36
43
|
return res.data;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Uploads an account post.
|
|
4
|
+
* @param {*} content - The account post comment.
|
|
5
|
+
* @param {*} str - The posting person's player ID or username.
|
|
6
|
+
* @param {*} password - The posting person's password.
|
|
7
|
+
*/
|
|
2
8
|
uploadAccountPost:
|
|
3
9
|
async function(content, str, password) {
|
|
4
10
|
const {encB64} = require("../misc/encB64.js");
|
|
@@ -28,7 +34,7 @@ module.exports = {
|
|
|
28
34
|
let res = await gjReq("uploadGJAccComment20", uACdata);
|
|
29
35
|
if(res.status == 500) throw new Error("500 Error: couldn't post!");
|
|
30
36
|
|
|
31
|
-
if(res.data
|
|
37
|
+
if(res.data == "error code: 1005") res = await gjWReq("uploadAccountPost", `?content=${encB64(content)}&user=${str}&password=${password}`);
|
|
32
38
|
if(res.status == 403) throw new Error(res.data.error);
|
|
33
39
|
|
|
34
40
|
return res.data;
|
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Uploads a comment to a level.
|
|
4
|
+
* @param {*} comment - The comment content.
|
|
5
|
+
* @param {*} id - The level ID to post comment on.
|
|
6
|
+
* @param {*} user - The posting person's player ID or username.
|
|
7
|
+
* @param {*} password - The posting person's password.
|
|
8
|
+
* @param {*} percent - The comment percentage.
|
|
9
|
+
*/
|
|
2
10
|
uploadComment:
|
|
3
|
-
async function(comment, id, user, password, percent = 0) {
|
|
4
|
-
if(!comment) throw new Error("Please provide a comment!");
|
|
5
|
-
if(!id) throw new Error("Please provide a level ID!");
|
|
6
|
-
if(!user) throw new Error("Please provide a username or a player ID!");
|
|
7
|
-
if(!password) throw new Error("Please provide a password!");
|
|
8
|
-
if(Number(percent) > 100) throw new Error("The percentage cannot be more than 100!");
|
|
11
|
+
async function (comment, id, user, password, percent = 0) {
|
|
12
|
+
if (!comment) throw new Error("Please provide a comment!");
|
|
13
|
+
if (!id) throw new Error("Please provide a level ID!");
|
|
14
|
+
if (!user) throw new Error("Please provide a username or a player ID!");
|
|
15
|
+
if (!password) throw new Error("Please provide a password!");
|
|
16
|
+
if (Number(percent) > 100) throw new Error("The percentage cannot be more than 100!");
|
|
9
17
|
|
|
10
18
|
const { gjp } = require("../misc/gjp.js");
|
|
11
19
|
const { encB64 } = require("../misc/encB64.js");
|
|
12
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
13
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
20
|
+
const { gjReq } = require("../misc/gjReq.js");
|
|
21
|
+
const { gjWReq } = require("../misc/gjWReq.js");
|
|
14
22
|
const crypto = require('crypto')
|
|
15
23
|
const { searchUsers } = require("./searchUsers.js");
|
|
16
24
|
|
|
@@ -19,7 +27,7 @@ module.exports = {
|
|
|
19
27
|
}
|
|
20
28
|
|
|
21
29
|
let userObj = await searchUsers(user);
|
|
22
|
-
|
|
30
|
+
|
|
23
31
|
const XOR = require("../misc/xor.js");
|
|
24
32
|
const xor = new XOR();
|
|
25
33
|
|
|
@@ -39,12 +47,12 @@ module.exports = {
|
|
|
39
47
|
|
|
40
48
|
let res = await gjReq("uploadGJComment21", uCdata);
|
|
41
49
|
|
|
42
|
-
if(res.data == -1) throw new Error("Whoops, the servers have rejected your request!");
|
|
43
|
-
if(res.data == -10) throw new Error("You're permanently banned from commenting!");
|
|
44
|
-
if(res.data.startsWith("temp_")) throw new Error(`You're temporarily banned from commenting!\nRemaining duration: ${
|
|
50
|
+
if (res.data == -1) throw new Error("Whoops, the servers have rejected your request!");
|
|
51
|
+
if (res.data == -10) throw new Error("You're permanently banned from commenting!");
|
|
52
|
+
if (res.data.startsWith("temp_")) throw new Error(`You're temporarily banned from commenting!\nRemaining duration: ${res.data.split("_")[1]} seconds\nReason: ${res.data.split("_")[2]}`);
|
|
45
53
|
|
|
46
|
-
if(res.data
|
|
47
|
-
if(res.status == 403) throw new Error(res.data.error)
|
|
54
|
+
if (res.data == "error code: 1005") res = await gjWReq("uploadComment", `${id}?comment=${encB64(comment)}&user=${user}&password=${password}&percent=${percent}`)
|
|
55
|
+
if (res.status == 403) throw new Error(res.data.error)
|
|
48
56
|
|
|
49
57
|
return res.data;
|
|
50
58
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
+
/**
|
|
3
|
+
* Sends a message to a user.
|
|
4
|
+
* @param {*} receiver - The message receiver.
|
|
5
|
+
* @param {*} subj - The message subject.
|
|
6
|
+
* @param {*} content - The message content.
|
|
7
|
+
* @param {*} user - The sending person's username or a player ID.
|
|
8
|
+
* @param {*} pass - The sending person's password.
|
|
9
|
+
*/
|
|
2
10
|
uploadMessage:
|
|
3
11
|
async function(receiver, subj, content, user, pass) {
|
|
4
12
|
if(!receiver) throw new Error("Please specify a message receiver!");
|
|
@@ -32,7 +40,7 @@ module.exports = {
|
|
|
32
40
|
let res = await gjReq("uploadGJMessage20", data);
|
|
33
41
|
if(res.data == -1) throw new Error(-1);
|
|
34
42
|
|
|
35
|
-
if(res.data
|
|
43
|
+
if(res.data == "error code: 1005") res = await gjWReq("uploadMessage", `?receiver=${receiver}&subject=${encB64(subj)}&content=${encB64(content)}&user=${user}&password=${pass}`)
|
|
36
44
|
if(res.status == 403) throw new Error(res.data.error)
|
|
37
45
|
|
|
38
46
|
return res.data;
|
package/index.js
CHANGED
|
@@ -1,65 +1 @@
|
|
|
1
|
-
const
|
|
2
|
-
const { getSongInfo } = require("./functions/getSongInfo.js");
|
|
3
|
-
const { getOfficialSongInfo } = require("./functions/getOfficialSongInfo.js");
|
|
4
|
-
const { getDailyLevel } = require("./functions/getDailyLevel.js");
|
|
5
|
-
const { getWeeklyDemon } = require("./functions/getWeeklyDemon.js");
|
|
6
|
-
const { getProfile } = require("./functions/getProfile.js");
|
|
7
|
-
const { reportLevel } = require("./functions/reportLevel.js");
|
|
8
|
-
const { getComments } = require("./functions/getComments.js");
|
|
9
|
-
const { getCommentHistory } = require("./functions/getCommentHistory.js");
|
|
10
|
-
const { getGauntlets } = require("./functions/getGauntlets.js");
|
|
11
|
-
const { getAccountPosts } = require("./functions/getAccountPosts.js");
|
|
12
|
-
const { uploadAccountPost } = require("./functions/uploadAccountPost.js");
|
|
13
|
-
const { uploadComment } = require("./functions/uploadComment.js");
|
|
14
|
-
const { getMapPacks } = require("./functions/getMapPacks.js");
|
|
15
|
-
const { blockUser } = require("./functions/blockUser.js");
|
|
16
|
-
const { getLevelByID } = require("./functions/getLevelByID.js");
|
|
17
|
-
const { getTop100 } = require("./functions/getTop100.js");
|
|
18
|
-
const { getCreatorScores } = require("./functions/getCreatorScores.js");
|
|
19
|
-
const { updateLevelDesc } = require("./functions/updateLevelDesc.js");
|
|
20
|
-
const { deleteAccountPost } = require("./functions/deleteAccountPost.js");
|
|
21
|
-
const { getUserLevels } = require("./functions/getUserLevels.js");
|
|
22
|
-
const { searchLevels } = require("./functions/searchLevels.js");
|
|
23
|
-
const { deleteComment } = require("./functions/deleteComment.js");
|
|
24
|
-
const { unblockUser } = require("./functions/unblockUser.js");
|
|
25
|
-
const { getMessages } = require("./functions/getMessages.js");
|
|
26
|
-
const { dlMessage } = require("./functions/dlMessage.js");
|
|
27
|
-
const { uploadMessage } = require("./functions/uploadMessage.js");
|
|
28
|
-
const { searchUsers } = require("./functions/searchUsers.js");
|
|
29
|
-
const { getFriendsList } = require("./functions/getFriendsList.js");
|
|
30
|
-
const { getBlockedList } = require("./functions/getBlockedList.js");
|
|
31
|
-
const { deleteLevel } = require("./functions/deleteLevel.js");
|
|
32
|
-
const { gjReq } = require("./misc/gjReq.js");
|
|
33
|
-
|
|
34
|
-
module.exports.dlLevel = dlLevel;
|
|
35
|
-
module.exports.getSongInfo = getSongInfo;
|
|
36
|
-
module.exports.getOfficialSongInfo = getOfficialSongInfo;
|
|
37
|
-
module.exports.getDailyLevel = getDailyLevel;
|
|
38
|
-
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
39
|
-
module.exports.getProfile = getProfile;
|
|
40
|
-
module.exports.reportLevel = reportLevel;
|
|
41
|
-
module.exports.getComments = getComments;
|
|
42
|
-
module.exports.getCommentHistory = getCommentHistory;
|
|
43
|
-
module.exports.getGauntlets = getGauntlets;
|
|
44
|
-
module.exports.getAccountPosts = getAccountPosts;
|
|
45
|
-
module.exports.uploadAccountPost = uploadAccountPost;
|
|
46
|
-
module.exports.uploadComment = uploadComment;
|
|
47
|
-
module.exports.getMapPacks = getMapPacks;
|
|
48
|
-
module.exports.blockUser = blockUser;
|
|
49
|
-
module.exports.getLevelByID = getLevelByID;
|
|
50
|
-
module.exports.getTop100 = getTop100;
|
|
51
|
-
module.exports.getCreatorScores = getCreatorScores;
|
|
52
|
-
module.exports.updateLevelDesc = updateLevelDesc;
|
|
53
|
-
module.exports.deleteAccountPost = deleteAccountPost;
|
|
54
|
-
module.exports.getUserLevels = getUserLevels;
|
|
55
|
-
module.exports.searchLevels = searchLevels;
|
|
56
|
-
module.exports.deleteComment = deleteComment;
|
|
57
|
-
module.exports.unblockUser = unblockUser;
|
|
58
|
-
module.exports.getMessages = getMessages;
|
|
59
|
-
module.exports.dlMessage = dlMessage;
|
|
60
|
-
module.exports.uploadMessage = uploadMessage;
|
|
61
|
-
module.exports.searchUsers = searchUsers;
|
|
62
|
-
module.exports.getFriendsList = getFriendsList;
|
|
63
|
-
module.exports.getBlockedList = getBlockedList;
|
|
64
|
-
module.exports.deleteLevel = deleteLevel;
|
|
65
|
-
module.exports.gjReq = gjReq;
|
|
1
|
+
const{dlLevel}=require("./functions/dlLevel.js");const{getSongInfo}=require("./functions/getSongInfo.js");const{getOfficialSongInfo}=require("./functions/getOfficialSongInfo.js");const{getDailyLevel}=require("./functions/getDailyLevel.js");const{getWeeklyDemon}=require("./functions/getWeeklyDemon.js");const{getProfile}=require("./functions/getProfile.js");const{reportLevel}=require("./functions/reportLevel.js");const{getComments}=require("./functions/getComments.js");const{getCommentHistory}=require("./functions/getCommentHistory.js");const{getGauntlets}=require("./functions/getGauntlets.js");const{getAccountPosts}=require("./functions/getAccountPosts.js");const{uploadAccountPost}=require("./functions/uploadAccountPost.js");const{uploadComment}=require("./functions/uploadComment.js");const{getMapPacks}=require("./functions/getMapPacks.js");const{blockUser}=require("./functions/blockUser.js");const{getLevelByID}=require("./functions/getLevelByID.js");const{getTop100}=require("./functions/getTop100.js");const{getCreatorScores}=require("./functions/getCreatorScores.js");const{updateLevelDesc}=require("./functions/updateLevelDesc.js");const{deleteAccountPost}=require("./functions/deleteAccountPost.js");const{getUserLevels}=require("./functions/getUserLevels.js");const{searchLevels}=require("./functions/searchLevels.js");const{deleteComment}=require("./functions/deleteComment.js");const{unblockUser}=require("./functions/unblockUser.js");const{getMessages}=require("./functions/getMessages.js");const{dlMessage}=require("./functions/dlMessage.js");const{uploadMessage}=require("./functions/uploadMessage.js");const{searchUsers}=require("./functions/searchUsers.js");const{getFriendsList}=require("./functions/getFriendsList.js");const{getBlockedList}=require("./functions/getBlockedList.js");const{deleteLevel}=require("./functions/deleteLevel.js");const{gjReq}=require("./misc/gjReq.js");const{getTab}=require("./functions/getTab.js");const{getLevelScores}=require("./functions/getLevelScores.js");module.exports={dlLevel:dlLevel,getSongInfo:getSongInfo,getOfficialSongInfo:getOfficialSongInfo,getDailyLevel:getDailyLevel,getWeeklyDemon:getWeeklyDemon,getProfile:getProfile,reportLevel:reportLevel,getComments:getComments,getCommentHistory:getCommentHistory,getGauntlets:getGauntlets,getAccountPosts:getAccountPosts,uploadAccountPost:uploadAccountPost,uploadComment:uploadComment,getMapPacks:getMapPacks,blockUser:blockUser,getLevelByID:getLevelByID,getTop100:getTop100,getCreatorScores:getCreatorScores,updateLevelDesc:updateLevelDesc,deleteAccountPost:deleteAccountPost,getUserLevels:getUserLevels,searchLevels:searchLevels,deleteComment:deleteComment,unblockUser:unblockUser,getMessages:getMessages,dlMessage:dlMessage,uploadMessage:uploadMessage,searchUsers:searchUsers,getFriendsList:getFriendsList,getBlockedList:getBlockedList,deleteLevel:deleteLevel,gjReq:gjReq,getTab:getTab,getLevelScores:getLevelScores};
|
package/misc/GJDecode.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports=class GJDecode{decCommentFromHistory(comment){const{decB64}=require("./decB64.js");let spl=comment.split("~");let cmnt=[];for(let i=0;i<spl.length;i++){if(i%2!=0){cmnt.push(spl[i-1]+`~`+spl[i])}}let levelID=cmnt[1].split("~")[1];let commentContent=cmnt[0].split("~")[1];let playerID=cmnt[2].split("~")[1];let likes=cmnt[3].split("~")[1];let percent=cmnt[4].split("~")[1];let age=cmnt[5].split("~")[1];let messageID=cmnt[6].split("~")[1].split(":")[0];let username=cmnt[7].split("~")[0];if(Number(cmnt[7].split("~")[0])!=NaN)username=cmnt[9].split("~")[0];const res={username:username,content:decB64(commentContent),levelID:Number(levelID),playerID:Number(playerID),likes:Number(likes),percent:Number(percent),id:Number(messageID),age:age};return res}decMessage(msg){const{decB64}=require("./decB64.js");const XOR=require("./xor.js");const xor=new XOR;let spl=msg.split(":");let msgInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){msgInfo.push(spl[i-1]+`:`+spl[i])}}let username=msgInfo[0].split("6:")[1];let playerID=msgInfo[1].split("3:")[1];let accID=msgInfo[2].split("2:")[1];let msgID=msgInfo[3].split("1:")[1];let title=msgInfo[4].split("4:")[1];let content=msgInfo[7].split("5:")[1];let age=msgInfo[8].split("7:")[1];return{username:username,title:decB64(title),content:xor.decrypt(content,14251),playerID:Number(playerID),accountID:Number(accID),messageID:Number(msgID),age:age}}decMsg(msg){const{decB64}=require("./decB64.js");let spl=msg.split("#")[0].split(":");let msgInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){msgInfo.push(spl[i-1]+`:`+spl[i])}}let username=msgInfo[0].split("6:")[1];let playerID=msgInfo[1].split("3:")[1];let accID=msgInfo[2].split("2:")[1];let msgID=msgInfo[3].split("1:")[1];let title=msgInfo[4].split("4:")[1];let age=msgInfo[7].split("7:")[1];return{username:username,title:decB64(title),playerID:Number(playerID),accountID:Number(accID),messageID:Number(msgID),age:age}}decodeAccountPost(post){const{decB64}=require("./decB64.js");let postContent=post.split("2~")[1].split("~4~")[0];let likes=post.split("~4~")[1].split("~9~")[0];let age=post.split("~9~")[1].split("~6~")[0];let id=post.split("~6~")[1];if(id.includes("~"))id=post.split("~6~")[2];if(id.includes("#"))id=id.split("#")[0];const result={content:decB64(postContent).trim(),likes:Number(likes),age:age,id:Number(id)};return result}decodeGJComment(comment){const{decB64}=require("./decB64.js");let spl=comment.split("~");let cmnt=[];for(let i=0;i<spl.length;i++){if(i%2!=0){cmnt.push(spl[i-1]+`~`+spl[i])}}let commentContent=cmnt[0].split("2~")[1];let playerID=cmnt[1].split("3~")[1];let likes=cmnt[2].split("4~")[1];let percent=cmnt[4].split("10~")[1];let age=cmnt[5].split("9~")[1];let msgID=cmnt[6].split("6~")[1];let username=comment.split(":1~")[1].split("~9")[0];if(msgID.includes(":"))msgID=msgID.split(":")[0];const res={username:username,content:decB64(commentContent),playerID:Number(playerID),likes:Number(likes),percent:Number(percent),id:Number(msgID),age:age};return res}decodeGJGauntlet(gauntlet){let spl=gauntlet.split(":");let id=spl[1];let lvlList=spl[3];let arr=lvlList.split(",");const glIDs={1:"Fire",2:"Ice",3:"Poison",4:"Shadow",5:"Lava",6:"Bonus",7:"Chaos",8:"Demon",9:"Time",10:"Crystal",11:"Magic",12:"spike",13:"Monster",14:"Doom",15:"Death"};let list=[Number(arr[0]),Number(arr[1]),Number(arr[2]),Number(arr[3]),Number(arr[4].split("#")[0])];const result={name:`${glIDs[id]} Gauntlet`,levels:list};return result}decodeLevelRes(level){const{decB64}=require("./decB64.js");let spl=level.split(":");let levelInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){levelInfo.push(spl[i-1]+`:`+spl[i])}}let id=levelInfo[0].split("1:")[1];let name=levelInfo[1].split("2:")[1];let version=levelInfo[2].split("5:")[1];let playerID=levelInfo[3].split("6:")[1];let difficulty=levelInfo[5].split("9:")[1];let downloads=levelInfo[6].split("10:")[1];let officialSong=levelInfo[7].split("12:")[1];let gameVersion=levelInfo[8].split("13:")[1];let likes=levelInfo[9].split("14:")[1];let demonBool=levelInfo[10].split("17:")[1];let stars=levelInfo[13].split("18:")[1];let ftrd=levelInfo[14].split("19:")[1];let epic=levelInfo[15].split("42:")[1];let objs=levelInfo[16].split("45:")[1];let desc=levelInfo[17].split("3:")[1];let length=levelInfo[18].split("15:")[1];let copiedID=levelInfo[19].split("30:")[1];let twoPlayer=levelInfo[20].split("31:")[1];let coins=levelInfo[21].split("37:")[1];let verifiedCoins=levelInfo[22].split("38:")[1];let starsRequested=levelInfo[23].split("39:")[1];let customSong=levelInfo[26].split("35:")[1].split("#")[0];let disliked=likes.includes("-")?true:false;if(desc.includes("/"))desc=desc.split("/")[0];if(decB64(desc)=="")desc="KE5vIGRlc2NyaXB0aW9uIHByb3ZpZGVkKQ==";let featured=Boolean(Number(ftrd));let difficultyDecoding={"-10":"Auto",0:"Unrated",10:"Easy",20:"Normal",30:"Hard",40:"Harder",50:"Insane"};if(Boolean(Number(demonBool))){difficultyDecoding={10:"Easy Demon",20:"Medium Demon",30:"Hard Demon",40:"Insane Demon",50:"Extreme Demon"}}const lengthDecoding={0:"Tiny",1:"Short",2:"Medium",3:"Long",4:"XL"};const decodeGameVersion={1:"Pre-1.7",2:"Pre-1.7",3:"Pre-1.7",4:"Pre-1.7",5:"Pre-1.7",6:"Pre-1.7",7:"Pre-1.7",10:"1.7",18:"1.8",19:"1.9",20:"2.0",21:"2.1"};let result={id:Number(id),name:name,description:decB64(desc),level_version:Number(version),difficulty:difficultyDecoding[difficulty],stars:Number(stars),downloads:Number(downloads),likes:Number(likes),disliked:disliked,length:lengthDecoding[length],demon:Boolean(Number(demonBool)),featured:featured,epic:Boolean(Number(epic)),objects:Number(objs),stars_requested:Number(starsRequested),game_version:decodeGameVersion[gameVersion],copied:Number(copiedID),large:Number(objs)>4e4?true:false,two_p:Boolean(Number(twoPlayer)),coins:Number(coins),verified_coins:Boolean(Number(verifiedCoins))};return{res:result,playerID:playerID,officialSong:officialSong,customSong:customSong}}decodeMapPack(mp){let spl=mp.split(":");let mpInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){mpInfo.push(spl[i-1]+`:`+spl[i])}}let mappackID=mpInfo[0].split("1:")[1];let name=mpInfo[1].split("2:")[1];let list=mpInfo[2].split("3:")[1];let stars=mpInfo[3].split("4:")[1];let coins=mpInfo[4].split("5:")[1];let difficulty=mpInfo[5].split("6:")[1];let txtCol=mpInfo[6].split("7:")[1];let barCol=mpInfo[7].split("8:")[1];let firstLvl=list.split(",")[0];let secondLvl=list.split(",")[1];let thirdLvl=list.split(",")[2];let difficultyDecoder={0:"Auto",1:"Easy",2:"Normal",3:"Hard",4:"Harder",5:"Insane",6:"Hard Demon",7:"Easy Demon",8:"Medium Demon",9:"Insane Demon",10:"Extreme Demon"};const{rgbToHEX}=require("./rgbToHEX.js");const result={name:name,id:Number(mappackID),levels:[Number(firstLvl),Number(secondLvl),Number(thirdLvl)],stars:Number(stars),coins:Number(coins),difficulty:difficultyDecoder[difficulty],textColor:rgbToHEX(txtCol),barColor:rgbToHEX(barCol)};return result}decodeUserResult(user){let spl=user.split(":");let userInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){userInfo.push(spl[i-1]+`:`+spl[i])}}let name=userInfo[0].split("1:")[1];let playerID=userInfo[1].split("2:")[1];let coins=userInfo[2].split("13:")[1];let userCoins=userInfo[3].split("17:")[1];let c1=userInfo[6].split("10:")[1];let c2=userInfo[7].split("11:")[1];let accID=userInfo[10].split("16:")[1];let stars=userInfo[11].split("3:")[1];let cp=userInfo[12].split("8:")[1];let demons=userInfo[13].split("4:")[1].split("#")[0];let colors=require("./colors.json");const{rgbToHEX}=require("./rgbToHEX.js");const result={username:name.trim(),playerID:Number(playerID),accountID:Number(accID),color1:rgbToHEX(colors[c1]),color2:rgbToHEX(colors[c2]),stars:Number(stars),secretCoins:Number(coins),userCoins:Number(userCoins),demons:Number(demons),creatorPoints:Number(cp)};return result}decScoresUser(user){let spl=user.split(":");let userInfo=[];for(let i=0;i<spl.length;i++){if(i%2!=0){userInfo.push(spl[i-1]+`:`+spl[i])}}let name=userInfo[0].split("1:")[1];let playerID=userInfo[1].split("2:")[1];let coins=userInfo[2].split("13:")[1];let userCoins=userInfo[3].split("17:")[1];let c1=userInfo[6].split("10:")[1];let c2=userInfo[7].split("11:")[1];let rank=userInfo[4].split("6:")[1];let accID=userInfo[10].split("16:")[1];let stars=userInfo[11].split("3:")[1];let cp=userInfo[12].split("8:")[1];let diamonds=userInfo[13].split("46:")[1];let demons=userInfo[14].split("4:")[1];let colors=require("./colors.json");const{rgbToHEX}=require("./rgbToHEX.js");const result={username:name.trim(),playerID:playerID,accountID:accID,rank:rank,color1:rgbToHEX(colors[c1]),color2:rgbToHEX(colors[c2]),stars:stars,diamonds:diamonds,secretCoins:coins,userCoins:userCoins,demons:demons,creatorPoints:cp};return result}decodeScore(s){let score=s.split(":");let username=score[1];let playerID=Number(score[3]);let accID=Number(score[15]);let percent=Number(score[17]);let rank=Number(score[19]);let icon=Number(score[5]);let iconType=score[11];let c1=score[7];let c2=score[9];let coins=Number(score[21]);let age=score[23];let iconTypes={0:"icon",1:"ship",2:"ball",3:"ufo",4:"wave",5:"robot",6:"spider"};let colors=require("./colors.json");const{rgbToHEX}=require("./rgbToHEX.js");return{username:username.trim(),playerID:playerID,accountID:accID,rank:rank,color1:rgbToHEX(colors[c1]),color2:rgbToHEX(colors[c2]),icon:icon,iconType:iconTypes[iconType],percent:percent,coins:coins,age:age}}};
|
package/misc/colors.json
CHANGED
|
@@ -1,44 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"0": "125,255,0",
|
|
3
|
-
"1": "0,255,0",
|
|
4
|
-
"2": "0,255,125",
|
|
5
|
-
"3": "0,255,255",
|
|
6
|
-
"4": "0,125,255",
|
|
7
|
-
"5": "0,0,255",
|
|
8
|
-
"6": "125,0,255",
|
|
9
|
-
"7": "255,0,255",
|
|
10
|
-
"8": "255,0,125",
|
|
11
|
-
"9": "255,0,0",
|
|
12
|
-
"10": "255,125,0",
|
|
13
|
-
"11": "255,255,0",
|
|
14
|
-
"12": "255,255,255",
|
|
15
|
-
"13": "185,0,255",
|
|
16
|
-
"14": "255,185,0",
|
|
17
|
-
"15": "0,0,0",
|
|
18
|
-
"16": "0,200,255",
|
|
19
|
-
"17": "175,175,175",
|
|
20
|
-
"18": "90,90,90",
|
|
21
|
-
"19": "255,125,125",
|
|
22
|
-
"20": "0,175,75",
|
|
23
|
-
"21": "0,125,125",
|
|
24
|
-
"22": "0,75,175",
|
|
25
|
-
"23": "75,0,175",
|
|
26
|
-
"24": "125,0,125",
|
|
27
|
-
"25": "175,0,75",
|
|
28
|
-
"26": "175,75,0",
|
|
29
|
-
"27": "125,125,0",
|
|
30
|
-
"28": "75,175,0",
|
|
31
|
-
"29": "255,75,0",
|
|
32
|
-
"30": "150,50,0",
|
|
33
|
-
"31": "150,100,0",
|
|
34
|
-
"32": "100,150,0",
|
|
35
|
-
"33": "0,150,100",
|
|
36
|
-
"34": "0,100,150",
|
|
37
|
-
"35": "100,0,150",
|
|
38
|
-
"36": "150,0,100",
|
|
39
|
-
"37": "150,0,0",
|
|
40
|
-
"38": "0,150,0",
|
|
41
|
-
"39": "0,0,150",
|
|
42
|
-
"40": "125,255,175",
|
|
43
|
-
"41": "125,125,255"
|
|
44
|
-
}
|
|
1
|
+
{"0":"125,255,0","1":"0,255,0","2":"0,255,125","3":"0,255,255","4":"0,125,255","5":"0,0,255","6":"125,0,255","7":"255,0,255","8":"255,0,125","9":"255,0,0","10":"255,125,0","11":"255,255,0","12":"255,255,255","13":"185,0,255","14":"255,185,0","15":"0,0,0","16":"0,200,255","17":"175,175,175","18":"90,90,90","19":"255,125,125","20":"0,175,75","21":"0,125,125","22":"0,75,175","23":"75,0,175","24":"125,0,125","25":"175,0,75","26":"175,75,0","27":"125,125,0","28":"75,175,0","29":"255,75,0","30":"150,50,0","31":"150,100,0","32":"100,150,0","33":"0,150,100","34":"0,100,150","35":"100,0,150","36":"150,0,100","37":"150,0,0","38":"0,150,0","39":"0,0,150","40":"125,255,175","41":"125,125,255"}
|
package/misc/decB64.js
CHANGED
package/misc/encB64.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
encB64:
|
|
3
3
|
function(string) {
|
|
4
|
-
|
|
5
|
-
let str = btoa(unescape(encodeURIComponent(string))).replace(/\//g, '_').replace(/\+/g, '-');
|
|
6
|
-
return str;
|
|
4
|
+
return btoa(unescape(encodeURIComponent(string))).replace(/\//g, '_').replace(/\+/g, '-');
|
|
7
5
|
}
|
|
8
6
|
}
|