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,91 +1,27 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const { searchUsers } = require("./searchUsers.js");
|
|
17
|
-
|
|
18
|
-
let user = str;
|
|
19
|
-
if(isNaN(str)) user = await (await searchUsers(str)).playerID;
|
|
20
|
-
|
|
21
|
-
const data = {
|
|
22
|
-
type: 5,
|
|
23
|
-
str: user,
|
|
24
|
-
secret: secret,
|
|
25
|
-
page: Number(page) - 1
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let res = await gjReq("getGJLevels21", data);
|
|
29
|
-
|
|
30
|
-
if(res.data == "error code: 1005") {
|
|
31
|
-
res = await gjWReq("getUserLevels", `${str}?page=${page}`);
|
|
32
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
33
|
-
return res.data;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
let levels = res.data.split("#")[0].split("|");
|
|
37
|
-
let creators = res.data.split("#")[1].split("|");
|
|
38
|
-
let songs = res.data.split("#")[2].split("~:~");
|
|
39
|
-
|
|
40
|
-
let result = [];
|
|
41
|
-
|
|
42
|
-
let encCreators = {};
|
|
43
|
-
let encSongs = {};
|
|
44
|
-
|
|
45
|
-
creators.forEach(c => {
|
|
46
|
-
let playerID = c.split(":")[0];
|
|
47
|
-
let username = c.split(":")[1];
|
|
48
|
-
encCreators[playerID] = username;
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
songs.forEach(s => {
|
|
52
|
-
let songId = s.split("~|~")[1];
|
|
53
|
-
let songName = s.split("~|~")[3];
|
|
54
|
-
let songArtistID = s.split("~|~")[5];
|
|
55
|
-
let songArtist = s.split("~|~")[7];
|
|
56
|
-
let size = s.split("~|~")[9];
|
|
57
|
-
let link = s.split("~|~")[13];
|
|
58
|
-
|
|
59
|
-
encSongs[songId] = {
|
|
60
|
-
"name": songName,
|
|
61
|
-
"id": Number(songId),
|
|
62
|
-
"artist": songArtist,
|
|
63
|
-
"artistId": Number(songArtistID),
|
|
64
|
-
"fileSize": `${size} MB`,
|
|
65
|
-
"link": decodeURIComponent(link)
|
|
66
|
-
};
|
|
67
|
-
})
|
|
68
|
-
|
|
69
|
-
for(const l of levels) {
|
|
70
|
-
let decLvl = decodeLevelRes(l);
|
|
71
|
-
const { getOfficialSongInfo } = require("./getOfficialSongInfo.js");
|
|
72
|
-
|
|
73
|
-
let lvl = decLvl.res;
|
|
74
|
-
let officialSongID = Number(decLvl.officialSong);
|
|
75
|
-
let songID = Number(decLvl.customSong);
|
|
76
|
-
let playerId = decLvl.playerID;
|
|
77
|
-
let song;
|
|
78
|
-
|
|
79
|
-
if(officialSongID == 0 && songID != 0 || officialSongID != 0 && songID != 0) song = encSongs[songID.toString()];
|
|
80
|
-
if(officialSongID != 0 && songID == 0) song = getOfficialSongInfo(officialSongID + 1);
|
|
81
|
-
if(officialSongID == 0 && songID == 0) song = getOfficialSongInfo(1);
|
|
82
|
-
|
|
83
|
-
lvl['creator'] = encCreators[playerId] != undefined ? encCreators[playerId] : "-";
|
|
84
|
-
lvl['song'] = song;
|
|
85
|
-
|
|
86
|
-
result.push(lvl);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return result;
|
|
2
|
+
getUserLevels: async function (str, page = 1) {
|
|
3
|
+
if (!str) throw new Error("Please provide a username or player ID!");
|
|
4
|
+
|
|
5
|
+
const { gjReq } = require("../gjReq.js");
|
|
6
|
+
let GJDecode = require("../misc/GJDecode.js");
|
|
7
|
+
const { decodeSearchResults } = new GJDecode;
|
|
8
|
+
let playerID=str;
|
|
9
|
+
if (isNaN(str)) {
|
|
10
|
+
let search = await gjReq("getGJUsers20", {
|
|
11
|
+
str: str,
|
|
12
|
+
secret: "Wmfd2893gb7"
|
|
13
|
+
});
|
|
14
|
+
if (search.data == -1) return [];
|
|
15
|
+
playerID = search.data.split(":")[3];
|
|
90
16
|
}
|
|
17
|
+
|
|
18
|
+
const res = await gjReq("getGJLevels21", {
|
|
19
|
+
type: 5,
|
|
20
|
+
str: playerID,
|
|
21
|
+
secret: "Wmfd2893gb7",
|
|
22
|
+
page: Number(page) - 1
|
|
23
|
+
});
|
|
24
|
+
if (res.data == -1) return [];
|
|
25
|
+
return decodeSearchResults(res.data);
|
|
26
|
+
}
|
|
91
27
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const { dlLevel } = require("./dlLevel.js");
|
|
8
|
-
let res = await dlLevel(-2);
|
|
9
|
-
return res;
|
|
10
|
-
}
|
|
2
|
+
getWeeklyDemon: async function () {
|
|
3
|
+
const { dlLevel } = require("./dlLevel");
|
|
4
|
+
let res = await dlLevel(-2);
|
|
5
|
+
return res;
|
|
6
|
+
}
|
|
11
7
|
}
|
package/functions/reportLevel.js
CHANGED
|
@@ -1,26 +1,13 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Always returns 1, regardless of whether the level exists or not.
|
|
6
|
-
* @param {*} level - The level to report.
|
|
7
|
-
*/
|
|
8
|
-
reportLevel:
|
|
9
|
-
async function(level) {
|
|
10
|
-
if(!level) throw new Error("Please provide a level ID.");
|
|
11
|
-
if(isNaN(Number(level))) throw new Error("The level ID should be a number.");
|
|
2
|
+
reportLevel: async function (level) {
|
|
3
|
+
if (isNaN(level)) throw new Error("Please provide a valid level ID.");
|
|
4
|
+
const { gjReq } = require("../gjReq");
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
let res = await gjReq("reportGJLevel", {
|
|
7
|
+
levelID: level,
|
|
8
|
+
secret: "Wmfd2893gb7"
|
|
9
|
+
});
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
secret: "Wmfd2893gb7"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
let res = await gjReq("reportGJLevel", data);
|
|
22
|
-
if(res.data == "error code: 1005") res = await gjWReq("reportLevel", id);
|
|
23
|
-
|
|
24
|
-
return res.data;
|
|
25
|
-
}
|
|
11
|
+
return res.data;
|
|
12
|
+
}
|
|
26
13
|
}
|
|
@@ -1,86 +1,17 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type: 0,
|
|
18
|
-
str: query,
|
|
19
|
-
page: Number(page) - 1,
|
|
20
|
-
secret: secret
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
let res = await gjReq("getGJLevels21", data)
|
|
24
|
-
|
|
25
|
-
if(res.data == "error code: 1005") {
|
|
26
|
-
res = await gjWReq("searchLevels", `${query}?page=${page}`);
|
|
27
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
28
|
-
return res.data;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
let levels = res.data.split("#")[0].split("|");
|
|
32
|
-
let creators = res.data.split("#")[1].split("|");
|
|
33
|
-
let songs = res.data.split("#")[2].split("~:~");
|
|
34
|
-
|
|
35
|
-
let result = [];
|
|
36
|
-
|
|
37
|
-
let encCreators = {};
|
|
38
|
-
let encSongs = {};
|
|
39
|
-
|
|
40
|
-
creators.forEach(c => {
|
|
41
|
-
let playerID = c.split(":")[0];
|
|
42
|
-
let username = c.split(":")[1];
|
|
43
|
-
encCreators[playerID] = username;
|
|
44
|
-
})
|
|
45
|
-
|
|
46
|
-
songs.forEach(s => {
|
|
47
|
-
let songId = s.split("~|~")[1];
|
|
48
|
-
let songName = s.split("~|~")[3];
|
|
49
|
-
let songArtistID = s.split("~|~")[5];
|
|
50
|
-
let songArtist = s.split("~|~")[7];
|
|
51
|
-
let size = s.split("~|~")[9];
|
|
52
|
-
let link = s.split("~|~")[13];
|
|
53
|
-
|
|
54
|
-
encSongs[songId] = {
|
|
55
|
-
"name": songName,
|
|
56
|
-
"id": Number(songId),
|
|
57
|
-
"artist": songArtist,
|
|
58
|
-
"artistId": Number(songArtistID),
|
|
59
|
-
"fileSize": `${size} MB`,
|
|
60
|
-
"link": decodeURIComponent(link)
|
|
61
|
-
};
|
|
62
|
-
})
|
|
63
|
-
|
|
64
|
-
for(const l of levels) {
|
|
65
|
-
let decLvl = decodeLevelRes(l);
|
|
66
|
-
const { getOfficialSongInfo } = require("./getOfficialSongInfo.js");
|
|
67
|
-
|
|
68
|
-
let lvl = decLvl.res;
|
|
69
|
-
let officialSongID = Number(decLvl.officialSong);
|
|
70
|
-
let songID = Number(decLvl.customSong);
|
|
71
|
-
let playerId = decLvl.playerID;
|
|
72
|
-
let song;
|
|
73
|
-
|
|
74
|
-
if(officialSongID == 0 && songID != 0 || officialSongID != 0 && songID != 0) song = encSongs[songID.toString()];
|
|
75
|
-
if(officialSongID != 0 && songID == 0) song = getOfficialSongInfo(officialSongID + 1);
|
|
76
|
-
if(officialSongID == 0 && songID == 0) song = getOfficialSongInfo(1);
|
|
77
|
-
|
|
78
|
-
lvl['creator'] = encCreators[playerId] != undefined ? encCreators[playerId] : "-";
|
|
79
|
-
lvl['song'] = song;
|
|
80
|
-
|
|
81
|
-
result.push(lvl);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
2
|
+
searchLevels: async function (query, page = 1) {
|
|
3
|
+
const { gjReq } = require("../gjReq");
|
|
4
|
+
let GJDecode = require("../misc/GJDecode");
|
|
5
|
+
const { decodeSearchResults } = new GJDecode;
|
|
6
|
+
|
|
7
|
+
let res = await gjReq("getGJLevels21", {
|
|
8
|
+
type: 0,
|
|
9
|
+
str: query,
|
|
10
|
+
page: Number(page) - 1,
|
|
11
|
+
secret: "Wmfd2893gb7"
|
|
12
|
+
});
|
|
13
|
+
if (res.data == -1) return [];
|
|
14
|
+
|
|
15
|
+
return decodeSearchResults(res.data);
|
|
16
|
+
}
|
|
86
17
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
searchLists: async function (query, page = 1) {
|
|
3
|
+
const { gjReq } = require("../gjReq");
|
|
4
|
+
const GJDecode = require("../misc/GJDecode");
|
|
5
|
+
const { decodeLists } = new GJDecode;
|
|
6
|
+
const res = await gjReq("getGJLevelLists", {
|
|
7
|
+
type: 0,
|
|
8
|
+
str: query,
|
|
9
|
+
secret: "Wmfd2893gb7",
|
|
10
|
+
page: Number(page) - 1
|
|
11
|
+
})
|
|
12
|
+
if (res.data == -1) return [];
|
|
13
|
+
return decodeLists(res.data);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/functions/unblockUser.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {*} password - The unblocking person's password.
|
|
7
|
-
*/
|
|
8
|
-
unblockUser:
|
|
9
|
-
async function(target, username, password) {
|
|
10
|
-
if(!target) throw new Error("Please provide a target's player ID or username!");
|
|
11
|
-
if(!username) throw new Error("Please provide your player ID or username!");
|
|
12
|
-
if(!password) throw new Error("Please provide your password!");
|
|
2
|
+
unblockUser: async function (target, username, password) {
|
|
3
|
+
if (!target) throw new Error("Please provide a target's player ID or username!");
|
|
4
|
+
if (!username) throw new Error("Please provide a player ID or username!");
|
|
5
|
+
if (!password) throw new Error("Please provide a password!");
|
|
13
6
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
const { gjReq } = require("../gjReq");
|
|
8
|
+
const XOR = require("../xor");
|
|
9
|
+
const xor = new XOR;
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
let userSearch = await gjReq("getGJUsers20", {
|
|
12
|
+
str: username,
|
|
13
|
+
secret: "Wmfd2893gb7"
|
|
14
|
+
});
|
|
15
|
+
if (userSearch.data == -1) throw new Error(-1);
|
|
16
|
+
let userAccID = userSearch.data.split(":")[21];
|
|
20
17
|
|
|
21
|
-
|
|
18
|
+
let recSearch = await gjReq("getGJUsers20", {
|
|
19
|
+
str: target,
|
|
20
|
+
secret: "Wmfd2893gb7"
|
|
21
|
+
});
|
|
22
|
+
if (recSearch.data == -1) throw new Error(-1);
|
|
23
|
+
let targetAccID = recSearch.data.split(":")[21];
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
let res = await gjReq("unblockGJUser20", data)
|
|
31
|
-
if(res.data == -1) throw new Error(-1);
|
|
25
|
+
const data = {
|
|
26
|
+
secret: "Wmfd2893gb7",
|
|
27
|
+
targetAccountID: targetAccID,
|
|
28
|
+
accountID: userAccID,
|
|
29
|
+
gjp: xor.encrypt(password, 37526)
|
|
30
|
+
}
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
let res = await gjReq("unblockGJUser20", data);
|
|
33
|
+
if (res.data == -1) throw new Error(-1);
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
return res.data;
|
|
36
|
+
}
|
|
38
37
|
}
|
|
@@ -1,45 +1,29 @@
|
|
|
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
|
-
const uLDdata = {
|
|
30
|
-
accountID: userObj.accountID,
|
|
31
|
-
gjp: gjp(password),
|
|
32
|
-
levelID: level,
|
|
33
|
-
levelDesc: encB64(desc),
|
|
34
|
-
secret: secret
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let res = await gjReq("updateGJDesc20", uLDdata);
|
|
38
|
-
if(res.data == -1) throw new Error("-1 Failed to update the description.");
|
|
39
|
-
|
|
40
|
-
if(res.data == "error code: 1005") res = await gjWReq("updateLevelDesc", `${level}?content=${encB64(desc)}&user=${user}&password=${password}`);
|
|
41
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
42
|
-
|
|
43
|
-
return res.data;
|
|
44
|
-
}
|
|
2
|
+
updateLevelDesc: async function (level, desc, user, password) {
|
|
3
|
+
if (isNaN(level)) throw new Error("Please provide a valid level ID!");
|
|
4
|
+
if (!user) throw new Error("Please provide a player ID or name!");
|
|
5
|
+
if (!password) throw new Error("Please provide a password!");
|
|
6
|
+
|
|
7
|
+
const { gjReq } = require("../gjReq");
|
|
8
|
+
const XOR = require("../xor");
|
|
9
|
+
const xor = new XOR;
|
|
10
|
+
|
|
11
|
+
let search = await gjReq("getGJUsers20", {
|
|
12
|
+
str: user,
|
|
13
|
+
secret: "Wmfd2893gb7"
|
|
14
|
+
});
|
|
15
|
+
if (search.data == -1) throw new Error(-1);
|
|
16
|
+
let accID = search.data.split(":")[21];
|
|
17
|
+
|
|
18
|
+
let res = await gjReq("updateGJDesc20", {
|
|
19
|
+
accountID: accID,
|
|
20
|
+
gjp: xor.encrypt(password, 37526),
|
|
21
|
+
levelID: level,
|
|
22
|
+
levelDesc: Buffer.from(desc).toString("base64"),
|
|
23
|
+
secret: "Wmfd2893gb7"
|
|
24
|
+
});
|
|
25
|
+
if (res.data == -1) throw new Error("-1: Failed to update the description.");
|
|
26
|
+
|
|
27
|
+
return res.data;
|
|
28
|
+
}
|
|
45
29
|
}
|
|
@@ -1,42 +1,29 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @param {*} password - The posting person's password.
|
|
7
|
-
*/
|
|
8
|
-
uploadAccountPost:
|
|
9
|
-
async function(content, str, password) {
|
|
10
|
-
const {encB64} = require("../misc/encB64.js");
|
|
11
|
-
if(!content) throw new Error("Please provide an account post content!");
|
|
12
|
-
if(!str) throw new Error("Please provide a user ID or name!");
|
|
13
|
-
if(!password) throw new Error("Please provide a password!");
|
|
14
|
-
|
|
15
|
-
const {gjReq} = require("../misc/gjReq.js");
|
|
16
|
-
const {gjWReq} = require("../misc/gjWReq.js");
|
|
17
|
-
const { searchUsers } = require("./searchUsers.js");
|
|
2
|
+
uploadAccountPost: async function (content, str, password) {
|
|
3
|
+
if (!content) throw new Error("Please provide an account post content!");
|
|
4
|
+
if (!str) throw new Error("Please provide a user ID or name!");
|
|
5
|
+
if (!password) throw new Error("Please provide a password!");
|
|
18
6
|
|
|
19
|
-
|
|
7
|
+
const { gjReq } = require("../gjReq");
|
|
8
|
+
const XOR = require("../xor");
|
|
9
|
+
const xor = new XOR;
|
|
20
10
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
let search = await gjReq("getGJUsers20", {
|
|
12
|
+
str: str,
|
|
13
|
+
secret: "Wmfd2893gb7"
|
|
14
|
+
});
|
|
15
|
+
if (search.data == -1) throw new Error(-1);
|
|
16
|
+
let accID = search.data.split(":")[21];
|
|
25
17
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
let res = await gjReq("uploadGJAccComment20", {
|
|
19
|
+
accountID: accID,
|
|
20
|
+
secret: "Wmfd2893gb7",
|
|
21
|
+
gjp: xor.encrypt(password, 37526),
|
|
22
|
+
comment: Buffer.from(content).toString("base64"),
|
|
23
|
+
cType: 1
|
|
24
|
+
});
|
|
25
|
+
if (res.status == 500) throw new Error("500 Error: couldn't post!");
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if(res.data == "error code: 1005") res = await gjWReq("uploadAccountPost", `?content=${encB64(content)}&user=${str}&password=${password}`);
|
|
38
|
-
if(res.status == 403) throw new Error(res.data.error);
|
|
39
|
-
|
|
40
|
-
return res.data;
|
|
41
|
-
}
|
|
27
|
+
return res.data;
|
|
28
|
+
}
|
|
42
29
|
}
|
|
@@ -1,59 +1,45 @@
|
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
secret: "Wmfd2893gb7"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
let res = await gjReq("uploadGJComment21", uCdata);
|
|
49
|
-
|
|
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]}`);
|
|
53
|
-
|
|
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)
|
|
56
|
-
|
|
57
|
-
return res.data;
|
|
58
|
-
}
|
|
2
|
+
uploadComment: async function (comment, id, user, password, percent = 0) {
|
|
3
|
+
if (!comment) throw new Error("Please provide a comment!");
|
|
4
|
+
if (!id) throw new Error("Please provide a level ID!");
|
|
5
|
+
if (!user) throw new Error("Please provide a username or a player ID!");
|
|
6
|
+
if (!password) throw new Error("Please provide a password!");
|
|
7
|
+
if (Number(percent) > 100) throw new Error("The percentage cannot be more than 100!");
|
|
8
|
+
|
|
9
|
+
const { gjReq } = require("../gjReq.js");
|
|
10
|
+
const crypto = require('crypto')
|
|
11
|
+
|
|
12
|
+
function sha1(data) { return crypto.createHash("sha1").update(data, "binary").digest("hex"); }
|
|
13
|
+
|
|
14
|
+
let search = await gjReq("getGJUsers20", {
|
|
15
|
+
str: user,
|
|
16
|
+
secret: "Wmfd2893gb7"
|
|
17
|
+
});
|
|
18
|
+
if (search.data == -1) throw new Error(-1);
|
|
19
|
+
let username = search.data.split(":")[1];
|
|
20
|
+
let accID = search.data.split(":")[21];
|
|
21
|
+
|
|
22
|
+
const XOR = require("../xor.js");
|
|
23
|
+
const xor = new XOR;
|
|
24
|
+
|
|
25
|
+
let chkStr = username.toLowerCase() + Buffer.from(comment).toString("base64") + id + percent + "0xPT6iUrtws0J";
|
|
26
|
+
let chk = xor.encrypt(sha1(chkStr), 29481);
|
|
27
|
+
|
|
28
|
+
let res = await gjReq("uploadGJComment21", {
|
|
29
|
+
accountID: accID,
|
|
30
|
+
gjp: xor.encrypt(password, 37526),
|
|
31
|
+
userName: username.toLowerCase(),
|
|
32
|
+
comment: Buffer.from(comment).toString("base64"),
|
|
33
|
+
levelID: id,
|
|
34
|
+
percent: percent,
|
|
35
|
+
chk: chk,
|
|
36
|
+
secret: "Wmfd2893gb7"
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
if (res.data == -1) throw new Error("Whoops, the servers have rejected your request!");
|
|
40
|
+
if (res.data == -10) throw new Error("You're permanently banned from commenting!");
|
|
41
|
+
if (res.data.startsWith("temp_")) throw new Error(`You're temporarily banned from commenting!\nBan duration: ${res.data.split("_")[1]} seconds\nReason: ${res.data.split("_")[2]}`);
|
|
42
|
+
|
|
43
|
+
return res.data;
|
|
44
|
+
}
|
|
59
45
|
}
|