gj-boomlings-api 0.5.0 → 1.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/config.json +10 -1
- package/docs/blockUser.md +21 -0
- package/docs/deleteAccountPost.md +23 -0
- package/docs/getCreatorScores.md +60 -0
- package/docs/getGauntlets.md +1 -1
- package/docs/getLevelByID.md +51 -0
- package/docs/getTop100.md +56 -0
- package/docs/getUserLevels.md +84 -0
- package/docs/objects/level.md +1 -1
- package/docs/searchLevels.md +113 -0
- package/docs/updateLevelDesc.md +23 -0
- package/functions/blockUser.js +60 -0
- package/functions/deleteAccountPost.js +52 -0
- package/functions/dlLevel.js +3 -2
- package/functions/getAccountPosts.js +13 -9
- package/functions/getCommentHistory.js +9 -0
- package/functions/getComments.js +4 -0
- package/functions/getCreatorScores.js +222 -0
- package/functions/getGauntlets.js +3 -0
- package/functions/getLevelByID.js +30 -0
- package/functions/getMapPacks.js +3 -0
- package/functions/getOfficialSongInfo.js +1 -7
- package/functions/getProfile.js +1 -0
- package/functions/getSongInfo.js +1 -0
- package/functions/getTop100.js +222 -0
- package/functions/getUserLevels.js +191 -0
- package/functions/reportLevel.js +2 -0
- package/functions/searchLevels.js +174 -0
- package/functions/updateLevelDesc.js +55 -0
- package/functions/uploadAccountPost.js +1 -0
- package/functions/uploadComment.js +2 -0
- package/index.js +17 -1
- package/misc/decodeAccountPost.js +6 -1
- package/misc/decodeLevel.js +166 -0
- package/misc/decodeUserResult.js +53 -0
- package/misc/officialsongs.json +0 -18
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -14,6 +14,14 @@ const { getAccountPosts } = require("./functions/getAccountPosts.js");
|
|
|
14
14
|
const { uploadAccountPost } = require("./functions/uploadAccountPost.js");
|
|
15
15
|
const { uploadComment } = require("./functions/uploadComment.js");
|
|
16
16
|
const { getMapPacks } = require("./functions/getMapPacks.js");
|
|
17
|
+
const { blockUser } = require("./functions/blockUser.js");
|
|
18
|
+
const { getLevelByID } = require("./functions/getLevelByID.js");
|
|
19
|
+
const { getTop100 } = require("./functions/getTop100.js");
|
|
20
|
+
const { getCreatorScores } = require("./functions/getCreatorScores.js");
|
|
21
|
+
const { updateLevelDesc } = require("./functions/updateLevelDesc.js");
|
|
22
|
+
const { deleteAccountPost } = require("./functions/deleteAccountPost.js");
|
|
23
|
+
const { getUserLevels } = require("./functions/getUserLevels.js");
|
|
24
|
+
const { searchLevels } = require("./functions/searchLevels.js");
|
|
17
25
|
|
|
18
26
|
module.exports.dlLevel = dlLevel;
|
|
19
27
|
module.exports.getSongInfo = getSongInfo;
|
|
@@ -30,4 +38,12 @@ module.exports.getGauntlets = getGauntlets;
|
|
|
30
38
|
module.exports.getAccountPosts = getAccountPosts;
|
|
31
39
|
module.exports.uploadAccountPost = uploadAccountPost;
|
|
32
40
|
module.exports.uploadComment = uploadComment;
|
|
33
|
-
module.exports.getMapPacks = getMapPacks;
|
|
41
|
+
module.exports.getMapPacks = getMapPacks;
|
|
42
|
+
module.exports.blockUser = blockUser;
|
|
43
|
+
module.exports.getLevelByID = getLevelByID;
|
|
44
|
+
module.exports.getTop100 = getTop100;
|
|
45
|
+
module.exports.getCreatorScores = getCreatorScores;
|
|
46
|
+
module.exports.updateLevelDesc = updateLevelDesc;
|
|
47
|
+
module.exports.deleteAccountPost = deleteAccountPost;
|
|
48
|
+
module.exports.getUserLevels = getUserLevels;
|
|
49
|
+
module.exports.searchLevels = searchLevels;
|
|
@@ -6,11 +6,16 @@ module.exports = {
|
|
|
6
6
|
let postContent = post.split("2~")[1].split("~4~")[0];
|
|
7
7
|
let likes = post.split("~4~")[1].split("~9~")[0];
|
|
8
8
|
let age = post.split("~9~")[1].split("~6~")[0];
|
|
9
|
+
let id = post.split("~6~")[1];
|
|
10
|
+
|
|
11
|
+
if(id.includes("~")) id = post.split("~6~")[2];
|
|
12
|
+
if(id.includes("#")) id = id.split("#")[0];
|
|
9
13
|
|
|
10
14
|
const result = {
|
|
11
15
|
content: bs.decode(postContent.replace(/_/g, '/').replace(/-/g, '+')).trim(),
|
|
12
16
|
likes: Number(likes),
|
|
13
|
-
age: age
|
|
17
|
+
age: age,
|
|
18
|
+
id: Number(id)
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
return result;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
decodeLevel:
|
|
3
|
+
function(level){
|
|
4
|
+
const bs = require("js-base64");
|
|
5
|
+
|
|
6
|
+
let spl = level.split(':');
|
|
7
|
+
let levelInfo = [];
|
|
8
|
+
for(let i =0;i<spl.length;i++) {
|
|
9
|
+
if(i%2!=0) {
|
|
10
|
+
levelInfo.push(spl[i-1]+`:`+spl[i]);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let id = levelInfo[0].split("1:")[1];
|
|
15
|
+
let name = levelInfo[1].split("2:")[1];
|
|
16
|
+
let version = levelInfo[2].split("5:")[1];
|
|
17
|
+
let difficulty = levelInfo[5].split("9:")[1];
|
|
18
|
+
let downloads = levelInfo[6].split("10:")[1];
|
|
19
|
+
let officialSong = levelInfo[7].split("12:")[1];
|
|
20
|
+
let gameVersion = levelInfo[8].split("13:")[1];
|
|
21
|
+
let likes = levelInfo[9].split("14:")[1];
|
|
22
|
+
let demonBool = levelInfo[10].split("17:")[1];
|
|
23
|
+
let stars = levelInfo[13].split("18:")[1];
|
|
24
|
+
let ftrd = levelInfo[14].split("19:")[1];
|
|
25
|
+
let epic = levelInfo[15].split("42:")[1];
|
|
26
|
+
let objs = levelInfo[16].split("45:")[1];
|
|
27
|
+
let desc = levelInfo[17].split("3:")[1];
|
|
28
|
+
let length = levelInfo[18].split("15:")[1];
|
|
29
|
+
let copiedID = levelInfo[19].split("30:")[1];
|
|
30
|
+
let twoPlayer = levelInfo[20].split("31:")[1];
|
|
31
|
+
let coins = levelInfo[21].split("37:")[1];
|
|
32
|
+
let verifiedCoins = levelInfo[22].split("38:")[1];
|
|
33
|
+
let starsRequested = levelInfo[23].split("39:")[1];
|
|
34
|
+
let customSong = levelInfo[26].split("35:")[1].split("#")[0];
|
|
35
|
+
let author = "-";
|
|
36
|
+
|
|
37
|
+
if(levelInfo.length == 29) {
|
|
38
|
+
author = levelInfo[27].split(":")[0];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
let disliked = false;
|
|
42
|
+
if(likes.includes("-")) disliked = true;
|
|
43
|
+
|
|
44
|
+
if(verifiedCoins == "0") verifiedCoins = false;
|
|
45
|
+
if(verifiedCoins == "1") verifiedCoins = true;
|
|
46
|
+
|
|
47
|
+
let demonBoolDecoding = {
|
|
48
|
+
'1': true,
|
|
49
|
+
'': false,
|
|
50
|
+
'0': false
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let featuredDecoding = {
|
|
54
|
+
"0": false,
|
|
55
|
+
"1": true,
|
|
56
|
+
undefined: true
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let featured = featuredDecoding[ftrd];
|
|
60
|
+
if(featured == undefined) featured = true;
|
|
61
|
+
|
|
62
|
+
let difficultyDecoding = {
|
|
63
|
+
"-10": "Auto",
|
|
64
|
+
"0": "Unrated",
|
|
65
|
+
"10": "Easy",
|
|
66
|
+
"20": "Normal",
|
|
67
|
+
"30": "Hard",
|
|
68
|
+
"40": "Harder",
|
|
69
|
+
"50": "Insane"
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if(demonBoolDecoding[demonBool] == true) {
|
|
73
|
+
difficultyDecoding = {
|
|
74
|
+
"10": "Easy Demon",
|
|
75
|
+
"20": "Medium Demon",
|
|
76
|
+
"30": "Hard Demon",
|
|
77
|
+
"40": "Insane Demon",
|
|
78
|
+
"50": "Extreme Demon"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const lengthDecoding = {
|
|
83
|
+
"0": "Tiny",
|
|
84
|
+
"1": "Short",
|
|
85
|
+
"2": "Medium",
|
|
86
|
+
"3": "Long",
|
|
87
|
+
"4": "XL"
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
if(lengthDecoding[length] == undefined) length = level.split(":15:")[2].split(":30")[0];
|
|
91
|
+
|
|
92
|
+
const decodeGameVersion = {
|
|
93
|
+
"1": "Pre-1.7",
|
|
94
|
+
"2": "Pre-1.7",
|
|
95
|
+
"3": "Pre-1.7",
|
|
96
|
+
"4": "Pre-1.7",
|
|
97
|
+
"5": "Pre-1.7",
|
|
98
|
+
"6": "Pre-1.7",
|
|
99
|
+
"7": "Pre-1.7",
|
|
100
|
+
"10": "1.7",
|
|
101
|
+
"18": "1.8",
|
|
102
|
+
"19": "1.9",
|
|
103
|
+
"20": "2.0",
|
|
104
|
+
"21": "2.1"
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const { getOfficialSongInfo } = require("../functions/getOfficialSongInfo.js");
|
|
108
|
+
|
|
109
|
+
let song;
|
|
110
|
+
|
|
111
|
+
if(Number(officialSong) > 0) {
|
|
112
|
+
song = getOfficialSongInfo(Number(officialSong) + 1);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if(Number(officialSong) == 0 && Number(customSong) == 0) {
|
|
116
|
+
song = getOfficialSongInfo(1);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if(Number(customSong) > 0) {
|
|
120
|
+
let songName = level.split("~|~2~|~")[1].split("~|~3~|~")[0]
|
|
121
|
+
let songId = Number(level.split("#1~|~")[1].split("~|~2~|~")[0])
|
|
122
|
+
let artist = level.split("~|~4~|~")[1].split("~|~5~|~")[0]
|
|
123
|
+
let artistId = Number(level.split("~|~3~|~")[1].split("~|~4~|~")[0])
|
|
124
|
+
let size = `${level.split("~|~5~|~")[1].split("~|~6~|~")[0]} MB`
|
|
125
|
+
let link = decodeURIComponent(level.split("~|~10~|~")[1].split("~|~7~|~")[0])
|
|
126
|
+
|
|
127
|
+
let songinfo = {
|
|
128
|
+
"name": songName,
|
|
129
|
+
"id": songId,
|
|
130
|
+
"artist": artist,
|
|
131
|
+
"artistId": artistId,
|
|
132
|
+
"fileSize": size,
|
|
133
|
+
"link": link
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
song = songinfo;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const result = {
|
|
140
|
+
id: Number(id),
|
|
141
|
+
name: name,
|
|
142
|
+
description: bs.decode(desc), //.replace(/-/g, "+").replace(/_/g, "/")
|
|
143
|
+
creator: author,
|
|
144
|
+
level_version: Number(version),
|
|
145
|
+
difficulty: difficultyDecoding[difficulty],
|
|
146
|
+
stars: Number(stars),
|
|
147
|
+
downloads: Number(downloads),
|
|
148
|
+
likes: Number(likes),
|
|
149
|
+
disliked: disliked,
|
|
150
|
+
length: lengthDecoding[length],
|
|
151
|
+
demon: demonBoolDecoding[demonBool],
|
|
152
|
+
featured: featured,
|
|
153
|
+
epic: demonBoolDecoding[epic],
|
|
154
|
+
objects: Number(objs),
|
|
155
|
+
stars_requested: Number(starsRequested),
|
|
156
|
+
game_version: decodeGameVersion[gameVersion],
|
|
157
|
+
copied: Number(copiedID),
|
|
158
|
+
two_p: demonBoolDecoding[twoPlayer],
|
|
159
|
+
coins: Number(coins),
|
|
160
|
+
verified_coins: verifiedCoins,
|
|
161
|
+
song: song,
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
decodeUserResult:
|
|
3
|
+
function(user) {
|
|
4
|
+
let sec = user.split(":16:")[1]
|
|
5
|
+
if(user.split(":16:")[2] != undefined) sec = user.split(":16:")[2]
|
|
6
|
+
let userWoSkins = `${user.split(":9:")[0]}:16:${sec}`
|
|
7
|
+
|
|
8
|
+
let name = userWoSkins.split(":")[1].split(":2:")[0];
|
|
9
|
+
let playerID = userWoSkins.split(":2:")[1].split(":13:")[0];
|
|
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];
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if(demons.includes(":")) demons = userWoSkins.split(":4:")[2]
|
|
28
|
+
if(userCoins.includes(":6")) userCoins = userCoins.split(":6")[0];
|
|
29
|
+
if(accID.startsWith("16:")) accID = accID.split("16:")[1];
|
|
30
|
+
if(stars.includes(":3:")) stars = stars.split(":3:")[1];
|
|
31
|
+
if(stars.includes("16:")) stars = userWoSkins.split(":3:")[2].split(":8:")[0];
|
|
32
|
+
if(diamonds.includes(":")) diamonds = userWoSkins.split(":46:")[2].split(":4:")[0];
|
|
33
|
+
if(cp.includes(":")) cp = userWoSkins.split(":8:")[2].split(":46:")[0];
|
|
34
|
+
if(rank.startsWith("16:")) rank = "9"
|
|
35
|
+
if(rank.includes(":16:")) rank = rank.split(":16:")[0];
|
|
36
|
+
if(accID.includes(":")) accID = userWoSkins.split(":16:")[2].split(":3:")[0];
|
|
37
|
+
|
|
38
|
+
const result = {
|
|
39
|
+
username: name.trim(),
|
|
40
|
+
playerID: Number(playerID),
|
|
41
|
+
accountID: Number(accID),
|
|
42
|
+
rank: Number(rank),
|
|
43
|
+
stars: Number(stars),
|
|
44
|
+
diamonds: Number(diamonds),
|
|
45
|
+
secretCoins: Number(coins),
|
|
46
|
+
userCoins: Number(userCoins),
|
|
47
|
+
demons: Number(demons),
|
|
48
|
+
creatorPoints: Number(cp)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
}
|
package/misc/officialsongs.json
CHANGED
|
@@ -207,24 +207,6 @@
|
|
|
207
207
|
"artist": "F-777",
|
|
208
208
|
"link": "https://www.youtube.com/watch?v=B8YkwDbGBr8"
|
|
209
209
|
},
|
|
210
|
-
"ps": {
|
|
211
|
-
"name": "Press Start",
|
|
212
|
-
"id": "Level 1 (Geometry Dash: SubZero)",
|
|
213
|
-
"artist": "MDK",
|
|
214
|
-
"link": "https://www.youtube.com/watch?v=XoLouT7TqZY"
|
|
215
|
-
},
|
|
216
|
-
"ne": {
|
|
217
|
-
"name": "Nock Em",
|
|
218
|
-
"id": "Level 2 (Geometry Dash: SubZero)",
|
|
219
|
-
"artist": "Bossfight",
|
|
220
|
-
"link": "https://www.youtube.com/watch?v=ePv2X_CCaGg"
|
|
221
|
-
},
|
|
222
|
-
"pt": {
|
|
223
|
-
"name": "Power Trip",
|
|
224
|
-
"id": "Level 3 (Geometry Dash: SubZero)",
|
|
225
|
-
"artist": "Boom Kitty",
|
|
226
|
-
"link": "https://www.youtube.com/watch?v=l6OsF7RlQb4"
|
|
227
|
-
},
|
|
228
210
|
"unknown": {
|
|
229
211
|
"name": "Unknown",
|
|
230
212
|
"id": "This song is not defined by RobTop. In game it returns \"Back on Track\".",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gj-boomlings-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A Node.js module that allows you to fetch boomlings.com easily",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"bugs": {
|
|
16
16
|
"url": "https://github.com/shikoshib/gj-boomlings-api/issues"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://github.com/shikoshib/gj-boomlings-api",
|
|
18
|
+
"homepage": "https://github.com/shikoshib/gj-boomlings-api#readme",
|
|
19
19
|
"keywords": [
|
|
20
20
|
"geometrydash",
|
|
21
21
|
"gd",
|