gj-boomlings-api 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/functions/blockUser.js +16 -14
- package/functions/deleteAccountPost.js +1 -2
- package/functions/getAccountPosts.js +7 -9
- package/functions/getCommentHistory.js +6 -9
- package/functions/getComments.js +3 -4
- package/functions/getGauntlets.js +2 -3
- package/functions/getLevelByID.js +3 -4
- package/functions/getMapPacks.js +3 -3
- package/functions/getSongInfo.js +13 -13
- package/functions/reportLevel.js +2 -5
- package/functions/updateLevelDesc.js +6 -9
- package/functions/uploadAccountPost.js +4 -4
- package/functions/uploadComment.js +3 -1
- package/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
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
4
|
<a href="https://www.npmjs.com/package/gj-boomlings-api"><img src="https://img.shields.io/npm/dt/gj-boomlings-api.svg?maxAge=3600" alt="npm downloads" /></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
|
+
<a href="https://packagequality.com/#?package=gj-boomlings-api"><img src="https://packagequality.com/shield/gj-boomlings-api.svg"/></a>
|
|
6
7
|
</div>
|
|
7
8
|
|
|
8
9
|
This package gets info from RobTop's servers (boomlings.com) and converts it into pure and beautiful JSON.
|
package/functions/blockUser.js
CHANGED
|
@@ -6,14 +6,6 @@ module.exports = {
|
|
|
6
6
|
if(!password || password == "") throw new Error("Please provide your password!");
|
|
7
7
|
const axios = require("axios");
|
|
8
8
|
const {headers, server} = require("../config.json");
|
|
9
|
-
|
|
10
|
-
const userData = {
|
|
11
|
-
gameVersion: 21,
|
|
12
|
-
binaryVersion: 35,
|
|
13
|
-
gdw: 0,
|
|
14
|
-
str: target,
|
|
15
|
-
secret: "Wmfd2893gb7"
|
|
16
|
-
}
|
|
17
9
|
|
|
18
10
|
let resp = await axios.post(server + "getGJUsers20.php", {
|
|
19
11
|
gameVersion: 21,
|
|
@@ -23,17 +15,27 @@ module.exports = {
|
|
|
23
15
|
secret: "Wmfd2893gb7"
|
|
24
16
|
}, {
|
|
25
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)
|
|
26
21
|
})
|
|
27
|
-
|
|
28
|
-
if(resp.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
22
|
+
|
|
29
23
|
let accID = resp.data.split(":16:")[1].split(":3:")[0];
|
|
30
24
|
|
|
25
|
+
const userData = {
|
|
26
|
+
gameVersion: 21,
|
|
27
|
+
binaryVersion: 35,
|
|
28
|
+
gdw: 0,
|
|
29
|
+
str: target,
|
|
30
|
+
secret: "Wmfd2893gb7"
|
|
31
|
+
}
|
|
31
32
|
|
|
32
33
|
let r = await axios.post(server + "getGJUsers20.php", userData, {
|
|
33
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)
|
|
34
38
|
})
|
|
35
|
-
if(r.data == -1) throw new Error(`Couldn't find a "${username}" user.`)
|
|
36
|
-
if(r.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
37
39
|
let targetId = r.data.split(":16:")[1].split(":3:")[0];
|
|
38
40
|
|
|
39
41
|
const {gjp} = require("../misc/gjp.js");
|
|
@@ -51,8 +53,8 @@ module.exports = {
|
|
|
51
53
|
let res = await axios.post(server + "blockGJUser20.php", blockData, {
|
|
52
54
|
headers: headers
|
|
53
55
|
}).catch(e => {
|
|
54
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
55
|
-
throw new Error(
|
|
56
|
+
if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
57
|
+
throw new Error(e)
|
|
56
58
|
})
|
|
57
59
|
|
|
58
60
|
return 1;
|
|
@@ -20,11 +20,10 @@ module.exports = {
|
|
|
20
20
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
21
21
|
headers: headers
|
|
22
22
|
}).catch(e => {
|
|
23
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
23
24
|
throw new Error(e.response.data);
|
|
24
25
|
})
|
|
25
26
|
|
|
26
|
-
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
27
|
-
|
|
28
27
|
let accId = r.data.split(":16:")[1].split(":3:")[0];
|
|
29
28
|
if(Number(accId) < 71 || accId.includes(":")) accId = r.data.split(":16:")[2].split(":3:")[0];
|
|
30
29
|
|
|
@@ -16,12 +16,11 @@ module.exports = {
|
|
|
16
16
|
|
|
17
17
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
18
18
|
headers: headers
|
|
19
|
+
}).catch(e => {
|
|
20
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
21
|
+
throw new Error(e.response.data);
|
|
19
22
|
})
|
|
20
23
|
|
|
21
|
-
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
22
|
-
if(r.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
23
|
-
if(r.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).")
|
|
24
|
-
|
|
25
24
|
let id = r.data.split(":16:")[1].split(":3:")[0];
|
|
26
25
|
if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
|
|
27
26
|
|
|
@@ -36,12 +35,11 @@ module.exports = {
|
|
|
36
35
|
|
|
37
36
|
let res = await axios.post(server + "getGJAccountComments20.php", ACdata, {
|
|
38
37
|
headers: headers
|
|
38
|
+
}).catch(e => {
|
|
39
|
+
if(e.response.data == -1) throw new Error("-1 Not found.");
|
|
40
|
+
if(e.response.data.startsWith("#")) throw new Error("Whoops! Couldn't find anything!");
|
|
41
|
+
throw new Error(e.response.data);
|
|
39
42
|
})
|
|
40
|
-
|
|
41
|
-
if(res.data == -1) throw new Error("-1 Not found.")
|
|
42
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
43
|
-
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).")
|
|
44
|
-
if(res.data.startsWith("#")) throw new Error("Whoops! Couldn't find anything!");
|
|
45
43
|
|
|
46
44
|
let firstPost = res.data;
|
|
47
45
|
let secondPost;
|
|
@@ -17,12 +17,11 @@ module.exports = {
|
|
|
17
17
|
|
|
18
18
|
let r = await axios.post(server + "getGJUsers20.php", userData, {
|
|
19
19
|
headers: headers
|
|
20
|
+
}).catch(e => {
|
|
21
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
22
|
+
throw new Error(e.response.data);
|
|
20
23
|
})
|
|
21
24
|
|
|
22
|
-
if(r.data == -1) throw new Error("-1 Not found.");
|
|
23
|
-
if(r.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
24
|
-
if(r.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).")
|
|
25
|
-
|
|
26
25
|
let id = r.data.split(":2:")[1].split(":13:")[0];
|
|
27
26
|
|
|
28
27
|
const user = await getProfile(id);
|
|
@@ -40,12 +39,10 @@ module.exports = {
|
|
|
40
39
|
|
|
41
40
|
let res = await axios.post(server + "getGJCommentHistory.php", CHData, {
|
|
42
41
|
headers: headers
|
|
42
|
+
}).catch(e => {
|
|
43
|
+
if(e.response.data == -1) throw new Error("-1 Not found.");
|
|
44
|
+
throw new Error(e.response.data);
|
|
43
45
|
})
|
|
44
|
-
|
|
45
|
-
if(res.data == -1) throw new Error("-1 Not found.");
|
|
46
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
47
|
-
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).")
|
|
48
|
-
|
|
49
46
|
|
|
50
47
|
let firstComment = res.data;
|
|
51
48
|
let secondComment;
|
package/functions/getComments.js
CHANGED
|
@@ -19,12 +19,11 @@ module.exports = {
|
|
|
19
19
|
|
|
20
20
|
let res = await axios.post(server + "getGJComments21.php", data, {
|
|
21
21
|
headers: headers
|
|
22
|
+
}).catch(e => {
|
|
23
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
24
|
+
throw new Error(e.response.data);
|
|
22
25
|
})
|
|
23
26
|
|
|
24
|
-
if(res.data == -1) throw new Error("-1 Not found.");
|
|
25
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
26
|
-
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).")
|
|
27
|
-
|
|
28
27
|
let firstComment = res.data;
|
|
29
28
|
let secondComment;
|
|
30
29
|
let thirdComment;
|
|
@@ -14,10 +14,9 @@ module.exports = {
|
|
|
14
14
|
|
|
15
15
|
let res = await axios.post(server + "getGJGauntlets21.php", data, {
|
|
16
16
|
headers: headers
|
|
17
|
+
}).catch(e => {
|
|
18
|
+
throw new Error(e.response.data);
|
|
17
19
|
})
|
|
18
|
-
|
|
19
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
20
|
-
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).")
|
|
21
20
|
|
|
22
21
|
let first = res.data.split("|")[0];
|
|
23
22
|
let second = res.data.split("|")[1].split("|")[0];
|
|
@@ -19,11 +19,10 @@ module.exports = {
|
|
|
19
19
|
|
|
20
20
|
let res = await axios.post(server + "getGJLevels21.php", data, {
|
|
21
21
|
headers: headers
|
|
22
|
+
}).catch(e => {
|
|
23
|
+
if(e.response.data == -1) throw new Error("-1 Not found.");
|
|
24
|
+
throw new Error(e.response.data);
|
|
22
25
|
})
|
|
23
|
-
|
|
24
|
-
if(res.data == -1) throw new Error("-1 Not found.");
|
|
25
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
26
|
-
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).")
|
|
27
26
|
|
|
28
27
|
return decodeLevel(res.data);
|
|
29
28
|
}
|
package/functions/getMapPacks.js
CHANGED
|
@@ -11,10 +11,10 @@ module.exports = {
|
|
|
11
11
|
|
|
12
12
|
let res = await axios.post(server + "getGJMapPacks21.php", data, {
|
|
13
13
|
headers: headers
|
|
14
|
+
}).catch(e => {
|
|
15
|
+
if(e.response.data == -1) throw new Error("-1 Not found.");
|
|
16
|
+
throw new Error(e.response.data);
|
|
14
17
|
})
|
|
15
|
-
|
|
16
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
17
|
-
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).")
|
|
18
18
|
|
|
19
19
|
let firstMapPack = res.data.split("|")[0];
|
|
20
20
|
let secondMapPack = res.data.split("|")[1].split("|")[0];
|
package/functions/getSongInfo.js
CHANGED
|
@@ -13,20 +13,20 @@ module.exports = {
|
|
|
13
13
|
|
|
14
14
|
let res = await axios.post(server + 'getGJSongInfo.php', data, {
|
|
15
15
|
headers: headers
|
|
16
|
+
}).catch(e => {
|
|
17
|
+
if(e.response.data == -2) throw new Error(`-2. Couldn't find a song with ID ${song}.`)
|
|
18
|
+
throw new Error(e.response.data);
|
|
16
19
|
})
|
|
17
20
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"link": decodeURIComponent(res.data.split("~|~10~|~")[1].split("~|~7~|~")[0])
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
21
|
+
const result = {
|
|
22
|
+
"name": res.data.split("|~2~|~")[1].split("~|~3~|~")[0],
|
|
23
|
+
"id": Number(res.data.split("1~|~")[1].split("~|~2~|")[0]),
|
|
24
|
+
"artist": res.data.split("~|~4~|~")[1].split("~|~5~|~")[0],
|
|
25
|
+
"artistId": Number(res.data.split("~|~3~|~")[1].split("~|~4~|~")[0]),
|
|
26
|
+
"fileSize": `${res.data.split("~|~5~|~")[1].split("~|~6~|~")[0]} MB`,
|
|
27
|
+
"link": decodeURIComponent(res.data.split("~|~10~|~")[1].split("~|~7~|~")[0])
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return result;
|
|
31
31
|
}
|
|
32
32
|
}
|
package/functions/reportLevel.js
CHANGED
|
@@ -14,12 +14,9 @@ module.exports = {
|
|
|
14
14
|
|
|
15
15
|
let res = await axios.post(server + "reportGJLevel.php", data, {
|
|
16
16
|
headers: headers
|
|
17
|
+
}).catch(e => {
|
|
18
|
+
throw new Error(e.response.data)
|
|
17
19
|
})
|
|
18
|
-
|
|
19
|
-
if(res.data == -1) throw new Error("-1 Request denied.");
|
|
20
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
21
|
-
if(res.data.toString().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).")
|
|
22
|
-
|
|
23
20
|
return res.data;
|
|
24
21
|
}
|
|
25
22
|
}
|
|
@@ -22,12 +22,10 @@ module.exports = {
|
|
|
22
22
|
|
|
23
23
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
24
24
|
headers: headers
|
|
25
|
+
}).catch(e => {
|
|
26
|
+
throw new Error(e.response.data);
|
|
25
27
|
})
|
|
26
28
|
|
|
27
|
-
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
28
|
-
if(r.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
29
|
-
if(r.data.toString().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).")
|
|
30
|
-
|
|
31
29
|
let id = r.data.split(":16:")[1].split(":3:")[0];
|
|
32
30
|
if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
|
|
33
31
|
|
|
@@ -44,12 +42,11 @@ module.exports = {
|
|
|
44
42
|
|
|
45
43
|
let res = await axios.post(server + "updateGJDesc20.php", uLDdata, {
|
|
46
44
|
headers: headers
|
|
45
|
+
}).catch(e => {
|
|
46
|
+
if(e.response.data == -1) throw new Error("-1 Failed to update the description.")
|
|
47
|
+
throw new Error(e.response.data);
|
|
47
48
|
})
|
|
48
|
-
|
|
49
|
-
if(res.data == -1) throw new Error("-1 Failed to update the description.")
|
|
50
|
-
if(res.data.toString().toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
51
|
-
if(res.data.toString().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).")
|
|
52
|
-
|
|
49
|
+
|
|
53
50
|
return 1;
|
|
54
51
|
}
|
|
55
52
|
}
|
|
@@ -18,9 +18,11 @@ module.exports = {
|
|
|
18
18
|
|
|
19
19
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
20
20
|
headers: headers
|
|
21
|
+
}).catch(e => {
|
|
22
|
+
if(e.response.data == -1) throw new Error("-1 This user is not found.");
|
|
23
|
+
throw new Error(e.response.data);
|
|
21
24
|
})
|
|
22
25
|
|
|
23
|
-
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
24
26
|
let id = r.data.split(":16:")[1].split(":3:")[0];
|
|
25
27
|
if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
|
|
26
28
|
|
|
@@ -44,10 +46,8 @@ module.exports = {
|
|
|
44
46
|
headers: headers
|
|
45
47
|
}).catch(e => {
|
|
46
48
|
if(e.response.status == 500) throw new Error("500 Error: couldn't post!");
|
|
49
|
+
throw new Error(e.response.data);
|
|
47
50
|
})
|
|
48
|
-
|
|
49
|
-
if(res.data.toLowerCase() == "error code: 1020") throw new Error("1020 error: Request denied.");
|
|
50
|
-
if(res.data.toString().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).")
|
|
51
51
|
|
|
52
52
|
return 1;
|
|
53
53
|
}
|
|
@@ -27,9 +27,11 @@ module.exports = {
|
|
|
27
27
|
|
|
28
28
|
let r = await axios.post(server + "getGJUsers20.php", data, {
|
|
29
29
|
headers: headers
|
|
30
|
+
}).catch(e => {
|
|
31
|
+
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
32
|
+
throw new Error(e.response.data)
|
|
30
33
|
})
|
|
31
34
|
|
|
32
|
-
if(r.data == -1) throw new Error("-1 This user is not found.")
|
|
33
35
|
let username = r.data.split("1:")[1].split(":2:")[0];
|
|
34
36
|
let accID = r.data.split(":16:")[1].split(":3:")[0];
|
|
35
37
|
if(Number(accID) < 71 || accID.includes(":")) accID = r.data.split(":16:")[2].split(":3:")[0];
|
package/index.js
CHANGED
|
@@ -23,14 +23,14 @@ const { deleteAccountPost } = require("./functions/deleteAccountPost.js");
|
|
|
23
23
|
const { getUserLevels } = require("./functions/getUserLevels.js");
|
|
24
24
|
const { searchLevels } = require("./functions/searchLevels.js");
|
|
25
25
|
|
|
26
|
-
module.exports.dlLevel = dlLevel;
|
|
26
|
+
module.exports.dlLevel = dlLevel; // to fix
|
|
27
27
|
module.exports.getSongInfo = getSongInfo;
|
|
28
28
|
module.exports.getOfficialSongInfo = getOfficialSongInfo;
|
|
29
29
|
module.exports.decURLSafeBase64 = decURLSafeBase64;
|
|
30
30
|
module.exports.encURLSafeBase64 = encURLSafeBase64;
|
|
31
31
|
module.exports.getDailyLevel = getDailyLevel;
|
|
32
32
|
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
33
|
-
module.exports.getProfile = getProfile;
|
|
33
|
+
module.exports.getProfile = getProfile; // to fix
|
|
34
34
|
module.exports.reportLevel = reportLevel;
|
|
35
35
|
module.exports.getComments = getComments;
|
|
36
36
|
module.exports.getCommentHistory = getCommentHistory;
|