gj-boomlings-api 1.0.2 → 1.1.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/README.md +1 -1
- package/functions/blockUser.js +1 -1
- package/functions/deleteComment.js +53 -0
- package/functions/dlLevel.js +3 -0
- package/functions/encURLSafeBase64.js +1 -1
- package/functions/getProfile.js +34 -48
- package/functions/unblockUser.js +62 -0
- package/functions/uploadComment.js +0 -2
- package/index.js +6 -2
- package/misc/decodeUserResult.js +20 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<div align="center">
|
|
2
2
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://shikoshib.github.io/font1.png" width="600"></a><hr>
|
|
3
3
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/v/gj-boomlings-api.svg?maxAge=3600" alt="npm version" /></a>
|
|
4
|
-
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/
|
|
4
|
+
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/dm/gj-boomlings-api.svg?maxAge=2592000" /></a>
|
|
5
5
|
<a href="https://snyk.io/test/github/shikoshib/gj-boomlings-api"><img src="https://snyk.io/test/github/shikoshib/gj-boomlings-api/badge.svg" alt="Known Vulnerabilities" /></a>
|
|
6
6
|
<a href="https://packagequality.com/#?package=gj-boomlings-api"><img src="https://packagequality.com/shield/gj-boomlings-api.svg"/></a>
|
|
7
7
|
</div>
|
package/functions/blockUser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
blockUser:
|
|
3
3
|
async function(target, username, password) {
|
|
4
|
-
if(!target || target == "") throw new Error("Please provide a player ID or username!");
|
|
4
|
+
if(!target || target == "") throw new Error("Please provide a target's player ID or username!");
|
|
5
5
|
if(!username || username == "") throw new Error("Please provide your player ID or username!");
|
|
6
6
|
if(!password || password == "") throw new Error("Please provide your password!");
|
|
7
7
|
const axios = require("axios");
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
deleteComment:
|
|
3
|
+
async function(id, lvl, str, password) {
|
|
4
|
+
const {encURLSafeBase64} = require("./encURLSafeBase64.js");
|
|
5
|
+
if(!id || id == "") throw new Error("Please provide a comment ID!");
|
|
6
|
+
if(!lvl || lvl == "") throw new Error("Please provide a level ID!");
|
|
7
|
+
if(!str || str == "") throw new Error("Please provide a user ID or name!");
|
|
8
|
+
if(!password || password == "") throw new Error("Please provide a password!");
|
|
9
|
+
|
|
10
|
+
const axios = require("axios");
|
|
11
|
+
const { headers, server } = require("../config.json");
|
|
12
|
+
|
|
13
|
+
const data = {
|
|
14
|
+
gameVersion: 21,
|
|
15
|
+
binaryVersion: 35,
|
|
16
|
+
gdw: 0,
|
|
17
|
+
str: str,
|
|
18
|
+
secret: "Wmfd2893gb7"
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
22
|
+
headers: headers
|
|
23
|
+
}).catch(e => {
|
|
24
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
25
|
+
throw new Error(e.response.data);
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
let accId = r.data.split(":16:")[1].split(":3:")[0];
|
|
29
|
+
if(Number(accId) < 71 || accId.includes(":")) accId = r.data.split(":16:")[2].split(":3:")[0];
|
|
30
|
+
|
|
31
|
+
const XOR = require("../misc/xor.js");
|
|
32
|
+
const xor = new XOR();
|
|
33
|
+
|
|
34
|
+
let dACdata = {
|
|
35
|
+
gameVersion: 21,
|
|
36
|
+
binaryVersion: 35,
|
|
37
|
+
gdw: 0,
|
|
38
|
+
accountID: accId,
|
|
39
|
+
secret: "Wmfd2893gb7",
|
|
40
|
+
levelID: lvl,
|
|
41
|
+
gjp: xor.encrypt(password, 37526),
|
|
42
|
+
commentID: id,
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
let res = await axios.post(server + "deleteGJComment20.php", dACdata, {
|
|
46
|
+
headers: headers
|
|
47
|
+
}).catch(e => {
|
|
48
|
+
throw new Error(e.response.data);
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
return 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
package/functions/dlLevel.js
CHANGED
|
@@ -21,6 +21,9 @@ module.exports = {
|
|
|
21
21
|
|
|
22
22
|
let res = await axios.post(server + 'downloadGJLevel22.php', data, {
|
|
23
23
|
headers: headers
|
|
24
|
+
}).catch(e => {
|
|
25
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
26
|
+
throw new Error(e.response.data);
|
|
24
27
|
})
|
|
25
28
|
|
|
26
29
|
let spl = res.data.split(":");
|
|
@@ -3,7 +3,7 @@ module.exports = {
|
|
|
3
3
|
function(string) {
|
|
4
4
|
const bs = require("js-base64");
|
|
5
5
|
if(!string || string == "") throw new Error("No string provided!")
|
|
6
|
-
let str = bs.encode(string).replace(/\//g, '_').replace(
|
|
6
|
+
let str = bs.encode(string).replace(/\//g, '_').replace(/\+/g, '-');
|
|
7
7
|
return str;
|
|
8
8
|
}
|
|
9
9
|
}
|
package/functions/getProfile.js
CHANGED
|
@@ -15,6 +15,9 @@ module.exports = {
|
|
|
15
15
|
|
|
16
16
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
17
17
|
headers: headers
|
|
18
|
+
}).catch(e => {
|
|
19
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
20
|
+
throw new Error(e.response.data);
|
|
18
21
|
})
|
|
19
22
|
|
|
20
23
|
let id = r.data.split(":16:")[1].split(":3:")[0];
|
|
@@ -30,58 +33,38 @@ module.exports = {
|
|
|
30
33
|
|
|
31
34
|
let res = await axios.post(server + "getGJUserInfo20.php", GJUI20data, {
|
|
32
35
|
headers: headers
|
|
36
|
+
}).catch(e => {
|
|
37
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
38
|
+
throw new Error(e.response.data);
|
|
33
39
|
})
|
|
34
|
-
|
|
35
|
-
if(res.data == -1) throw new Error("-1 Not found.")
|
|
36
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
37
|
-
if(res.data.toLowerCase() == "error code: 1005") throw new Error("1005 error: Your IP address has been blocked from sending requests to a server. It's recommended to use locally (directly from a PC).")
|
|
38
|
-
|
|
39
|
-
let dataWoSkins = `${res.data.split("21:")[0]}${res.data.split(":48:")[1]}`;
|
|
40
40
|
|
|
41
|
-
let
|
|
42
|
-
let
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let demons = dataWoSkins.split(":4:")[1].split(":8:")[0];
|
|
48
|
-
let cps = dataWoSkins.split(":8:")[1].split(":18:")[0]; // clicks per second lmao
|
|
49
|
-
let msgState = dataWoSkins.split(":18:")[1].split(":19:")[0];
|
|
50
|
-
let friendsState = dataWoSkins.split(":19:")[1].split(":50:")[0];
|
|
51
|
-
let commentHistoryState = dataWoSkins.split(":50:")[1].split(":20:")[0];
|
|
52
|
-
let youtube = dataWoSkins.split(":20:")[1].split(":")[0];
|
|
53
|
-
let rank = dataWoSkins.split(":30:")[1].split(":16:")[0];
|
|
54
|
-
let accountID = dataWoSkins.split(":16:")[1].split(":31:")[0];
|
|
55
|
-
let twitter = dataWoSkins.split(":44:")[1].split(":45:")[0];
|
|
56
|
-
let twitch = dataWoSkins.split(":45:")[1].split(":49:")[0];
|
|
57
|
-
let modState = dataWoSkins.split(":49:")[1].split(":29:")[0];
|
|
58
|
-
|
|
59
|
-
if(youtube.includes(":")) youtube = dataWoSkins.split(":20:")[1].split(":")[0];
|
|
60
|
-
if(twitter.includes(":")) twitter = dataWoSkins.split(":44:")[2].split(":45:")[0];
|
|
61
|
-
if(twitch.includes(":")) twitch = dataWoSkins.split(":45:")[2].split(":49:")[0];
|
|
62
|
-
if(goldCoins.includes(":")) goldCoins = dataWoSkins.split(":13:")[2].split(":17:")[0];
|
|
63
|
-
if(goldCoins == "") goldCoins = dataWoSkins.split(":13:")[1].split(":17:")[1];
|
|
64
|
-
if(silverCoins.includes(":")) silverCoins = dataWoSkins.split("17:")[2].split(":10:")[0];
|
|
65
|
-
if(rank.includes(":")) rank = dataWoSkins.split(":30:")[2].split(":16:")[0];
|
|
66
|
-
if(accountID.includes(":")) accountID = dataWoSkins.split(":16:")[2].split(":31:")[0];
|
|
67
|
-
if(demons.includes(":")) demons = dataWoSkins.split(":4:")[2].split(":8:")[0];
|
|
68
|
-
if(msgState.includes(":")) msgState = dataWoSkins.split(":18:")[2].split(":19:")[0];
|
|
69
|
-
if(stars.includes(":")) stars = dataWoSkins.split("3:")[2].split(":46:")[0];
|
|
70
|
-
if(modState.includes(":")) modState = dataWoSkins.split(":49:")[2].split(":29:")[0];
|
|
71
|
-
if(dataWoSkins.split(":3:")[1].split(":46:")[0].startsWith("3:")) stars = dataWoSkins.split(":3:")[1].split("3:")[1].split(":46:")[0];
|
|
72
|
-
if(dataWoSkins.split("3:")[2].split(":46:")[0].includes(":")) {
|
|
73
|
-
stars = dataWoSkins.split("3:")[3].split(":46:")[0];
|
|
74
|
-
} else {
|
|
75
|
-
stars = stars;
|
|
41
|
+
let spl = res.data.split(':');
|
|
42
|
+
let userInfo = [];
|
|
43
|
+
for(let i =0;i<spl.length;i++) {
|
|
44
|
+
if(i%2!=0) {
|
|
45
|
+
userInfo.push(spl[i-1]+`:`+spl[i]);
|
|
46
|
+
}
|
|
76
47
|
}
|
|
77
48
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
49
|
+
let username = userInfo[0].split("1:")[1];
|
|
50
|
+
let playerID = userInfo[1].split("2:")[1];
|
|
51
|
+
let goldCoins = userInfo[2].split("13:")[1];
|
|
52
|
+
let silverCoins = userInfo[3].split("17:")[1];
|
|
53
|
+
let p1col = userInfo[4].split("10:")[1];
|
|
54
|
+
let p2col = userInfo[5].split("11:")[1];
|
|
55
|
+
let stars = userInfo[6].split("3:")[1];
|
|
56
|
+
let diamonds = userInfo[7].split("46:")[1];
|
|
57
|
+
let demons = userInfo[8].split("4:")[1];
|
|
58
|
+
let cps = userInfo[9].split("8:")[1]; // clicks per second lmao
|
|
59
|
+
let msgState = userInfo[10].split("18:")[1];
|
|
60
|
+
let friendsState = userInfo[11].split("19:")[1];
|
|
61
|
+
let commentHistoryState = userInfo[12].split("50:")[1];
|
|
62
|
+
let youtube = userInfo[13].split("20:")[1];
|
|
63
|
+
let rank = userInfo[23].split("30:")[1];
|
|
64
|
+
let accountID = userInfo[24].split("16:")[1];
|
|
65
|
+
let twitter = userInfo[26].split("44:")[1];
|
|
66
|
+
let twitch = userInfo[27].split("45:")[1];
|
|
67
|
+
let modState = userInfo[28].split("49:")[1];
|
|
85
68
|
|
|
86
69
|
let ytLnk = `htps://youtube.com/channel/${youtube}`;
|
|
87
70
|
let twitterLnk = `https://twitter.com/${twitter}`;
|
|
@@ -116,6 +99,8 @@ module.exports = {
|
|
|
116
99
|
playerID: Number(playerID),
|
|
117
100
|
accountID: Number(accountID),
|
|
118
101
|
rank: Number(rank),
|
|
102
|
+
color1: Number(p1col),
|
|
103
|
+
color2: Number(p2col),
|
|
119
104
|
stars: Number(stars),
|
|
120
105
|
diamonds: Number(diamonds),
|
|
121
106
|
secretCoins: Number(goldCoins),
|
|
@@ -130,6 +115,7 @@ module.exports = {
|
|
|
130
115
|
twitter: twitterLnk,
|
|
131
116
|
twitch: twitchLnk
|
|
132
117
|
}
|
|
118
|
+
|
|
133
119
|
return result;
|
|
134
120
|
}
|
|
135
121
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
unblockUser:
|
|
3
|
+
async function(target, username, password) {
|
|
4
|
+
if(!target || target == "") throw new Error("Please provide a target's player ID or username!");
|
|
5
|
+
if(!username || username == "") throw new Error("Please provide your player ID or username!");
|
|
6
|
+
if(!password || password == "") throw new Error("Please provide your password!");
|
|
7
|
+
const axios = require("axios");
|
|
8
|
+
const {headers, server} = require("../config.json");
|
|
9
|
+
|
|
10
|
+
let resp = await axios.post(server + "getGJUsers20.php", {
|
|
11
|
+
gameVersion: 21,
|
|
12
|
+
binaryVersion: 35,
|
|
13
|
+
gdw: 0,
|
|
14
|
+
str: username,
|
|
15
|
+
secret: "Wmfd2893gb7"
|
|
16
|
+
}, {
|
|
17
|
+
headers: headers
|
|
18
|
+
}).catch(e => {
|
|
19
|
+
if(e.response.data == -1) throw new Error(`Couldn't find a "${username}" user.`)
|
|
20
|
+
throw new Error(e.response.data)
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
let accID = resp.data.split(":16:")[1].split(":3:")[0];
|
|
24
|
+
|
|
25
|
+
const userData = {
|
|
26
|
+
gameVersion: 21,
|
|
27
|
+
binaryVersion: 35,
|
|
28
|
+
gdw: 0,
|
|
29
|
+
str: target,
|
|
30
|
+
secret: "Wmfd2893gb7"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
let r = await axios.post(server + "getGJUsers20.php", userData, {
|
|
34
|
+
headers: headers
|
|
35
|
+
}).catch(e => {
|
|
36
|
+
if(e.response.data == -1) throw new Error(`Couldn't find a "${username}" user.`)
|
|
37
|
+
throw new Error(e.response.data)
|
|
38
|
+
})
|
|
39
|
+
let targetId = r.data.split(":16:")[1].split(":3:")[0];
|
|
40
|
+
|
|
41
|
+
const {gjp} = require("../misc/gjp.js");
|
|
42
|
+
|
|
43
|
+
const blockData = {
|
|
44
|
+
gameVersion: 21,
|
|
45
|
+
binaryVersion: 35,
|
|
46
|
+
gdw: 0,
|
|
47
|
+
secret: "Wmfd2893gb7",
|
|
48
|
+
targetAccountID: targetId,
|
|
49
|
+
accountID: accID,
|
|
50
|
+
gjp: gjp(password)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let res = await axios.post(server + "unblockGJUser20.php", blockData, {
|
|
54
|
+
headers: headers
|
|
55
|
+
}).catch(e => {
|
|
56
|
+
if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
57
|
+
throw new Error(e)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
return 1;
|
|
61
|
+
}
|
|
62
|
+
}
|
package/index.js
CHANGED
|
@@ -25,6 +25,8 @@ const { updateLevelDesc } = require("./functions/updateLevelDesc.js");
|
|
|
25
25
|
const { deleteAccountPost } = require("./functions/deleteAccountPost.js");
|
|
26
26
|
const { getUserLevels } = require("./functions/getUserLevels.js");
|
|
27
27
|
const { searchLevels } = require("./functions/searchLevels.js");
|
|
28
|
+
const { deleteComment } = require("./functions/deleteComment.js");
|
|
29
|
+
const { unblockUser } = require("./functions/unblockUser.js");
|
|
28
30
|
|
|
29
31
|
module.exports.dlLevel = dlLevel;
|
|
30
32
|
module.exports.getSongInfo = getSongInfo;
|
|
@@ -33,7 +35,7 @@ module.exports.decURLSafeBase64 = decURLSafeBase64;
|
|
|
33
35
|
module.exports.encURLSafeBase64 = encURLSafeBase64;
|
|
34
36
|
module.exports.getDailyLevel = getDailyLevel;
|
|
35
37
|
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
36
|
-
module.exports.getProfile = getProfile;
|
|
38
|
+
module.exports.getProfile = getProfile;
|
|
37
39
|
module.exports.reportLevel = reportLevel;
|
|
38
40
|
module.exports.getComments = getComments;
|
|
39
41
|
module.exports.getCommentHistory = getCommentHistory;
|
|
@@ -49,4 +51,6 @@ module.exports.getCreatorScores = getCreatorScores;
|
|
|
49
51
|
module.exports.updateLevelDesc = updateLevelDesc;
|
|
50
52
|
module.exports.deleteAccountPost = deleteAccountPost;
|
|
51
53
|
module.exports.getUserLevels = getUserLevels;
|
|
52
|
-
module.exports.searchLevels = searchLevels;
|
|
54
|
+
module.exports.searchLevels = searchLevels;
|
|
55
|
+
module.exports.deleteComment = deleteComment;
|
|
56
|
+
module.exports.unblockUser = unblockUser;
|
package/misc/decodeUserResult.js
CHANGED
|
@@ -1,45 +1,34 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
decodeUserResult:
|
|
3
3
|
function(user) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
let coins = userWoSkins.split(":13:")[1].split(":17:")[0];
|
|
11
|
-
let userCoins = userWoSkins.split(":17:")[1].split(":6:")[0];
|
|
12
|
-
let rank = userWoSkins.split(":6:")[1].split(":9:")[0];
|
|
13
|
-
let accID = userWoSkins.split(":16:")[1].split(":3:")[0];
|
|
14
|
-
let stars = userWoSkins.split(":3:")[1].split(":8:")[0];
|
|
15
|
-
let cp = userWoSkins.split(":8:")[1].split(":46:")[0];
|
|
16
|
-
let diamonds = userWoSkins.split(":46:")[1].split(":4:")[0];
|
|
17
|
-
let demons = userWoSkins.split(":4:")[1]
|
|
18
|
-
|
|
19
|
-
if(userWoSkins.split(":3:")[1] != undefined) {
|
|
20
|
-
if(userWoSkins.split(":3:")[1].split(":").length < 6) stars = userWoSkins.split(":2:")[1].split(":8:")[0];
|
|
21
|
-
}
|
|
22
|
-
if(rank.includes(":16:")) rank = rank.split(":16:")[0];
|
|
23
|
-
if(userWoSkins.split(":6:")[2] != undefined) {
|
|
24
|
-
if(rank.includes(":")) rank = userWoSkins.split(":6:")[2].split(":9:")[0];
|
|
4
|
+
let spl = user.split(':');
|
|
5
|
+
let userInfo = [];
|
|
6
|
+
for(let i =0;i<spl.length;i++) {
|
|
7
|
+
if(i%2!=0) {
|
|
8
|
+
userInfo.push(spl[i-1]+`:`+spl[i]);
|
|
9
|
+
}
|
|
25
10
|
}
|
|
26
11
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
12
|
+
let name = userInfo[0].split("1:")[1];
|
|
13
|
+
let playerID = userInfo[1].split("2:")[1];
|
|
14
|
+
let coins = userInfo[2].split("13:")[1];
|
|
15
|
+
let userCoins = userInfo[3].split("17:")[1];
|
|
16
|
+
let p1col = userInfo[6].split("10:")[1];
|
|
17
|
+
let p2col = userInfo[7].split("11:")[1];
|
|
18
|
+
let rank = userInfo[4].split("6:")[1];
|
|
19
|
+
let accID = userInfo[10].split("16:")[1];
|
|
20
|
+
let stars = userInfo[11].split("3:")[1];
|
|
21
|
+
let cp = userInfo[12].split("8:")[1];
|
|
22
|
+
let diamonds = userInfo[13].split("46:")[1];
|
|
23
|
+
let demons = userInfo[14].split("4:")[1];
|
|
37
24
|
|
|
38
25
|
const result = {
|
|
39
26
|
username: name.trim(),
|
|
40
27
|
playerID: Number(playerID),
|
|
41
28
|
accountID: Number(accID),
|
|
42
29
|
rank: Number(rank),
|
|
30
|
+
color1: Number(p1col),
|
|
31
|
+
color2: Number(p2col),
|
|
43
32
|
stars: Number(stars),
|
|
44
33
|
diamonds: Number(diamonds),
|
|
45
34
|
secretCoins: Number(coins),
|