gj-boomlings-api 0.1.5 → 0.1.7
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 +55 -22
- package/functions/dlLevel.js +2 -2
- package/functions/getLevelData.js +2 -1
- package/functions/getOfficialSongInfo.js +2 -1
- package/functions/getProfile.js +133 -0
- package/functions/getSongInfo.js +3 -2
- package/index.js +5 -1
- package/package.json +9 -1
- package/t.txt +1 -0
package/README.md
CHANGED
|
@@ -10,52 +10,85 @@ So basically this function downloads the entire level and converts the response
|
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
const gd = require("gj-boomlings-api");
|
|
13
|
-
gd.dlLevel(
|
|
13
|
+
gd.dlLevel(58825144).then(console.log);
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
Returns:
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
{
|
|
20
|
-
id:
|
|
21
|
-
name: '
|
|
22
|
-
description: '
|
|
23
|
-
creator: '
|
|
24
|
-
level_version:
|
|
20
|
+
id: 58825144,
|
|
21
|
+
name: 'xo',
|
|
22
|
+
description: 'stream vertigo',
|
|
23
|
+
creator: 'KrmaL',
|
|
24
|
+
level_version: 2,
|
|
25
25
|
difficulty: 'Extreme Demon',
|
|
26
26
|
stars: 10,
|
|
27
|
-
downloads:
|
|
28
|
-
likes:
|
|
27
|
+
downloads: 2587512,
|
|
28
|
+
likes: 106611,
|
|
29
29
|
disliked: false,
|
|
30
30
|
length: 'XL',
|
|
31
|
-
password: '
|
|
31
|
+
password: '000007',
|
|
32
32
|
demon: true,
|
|
33
|
-
featured:
|
|
34
|
-
epic:
|
|
35
|
-
objects:
|
|
36
|
-
uploaded: '
|
|
37
|
-
updated: '
|
|
33
|
+
featured: false,
|
|
34
|
+
epic: false,
|
|
35
|
+
objects: 37838,
|
|
36
|
+
uploaded: '2 years',
|
|
37
|
+
updated: '2 years',
|
|
38
38
|
stars_requested: 10,
|
|
39
39
|
game_version: '2.1',
|
|
40
40
|
ldm: false,
|
|
41
|
-
copied:
|
|
41
|
+
copied: 0,
|
|
42
42
|
two_p: false,
|
|
43
43
|
coins: 0,
|
|
44
44
|
verified_coins: false,
|
|
45
45
|
song: {
|
|
46
|
-
name: '
|
|
47
|
-
id:
|
|
48
|
-
artist: '
|
|
49
|
-
artistId:
|
|
50
|
-
fileSize: '
|
|
51
|
-
link: '
|
|
46
|
+
name: 'XO (Eden Cover & Remake)',
|
|
47
|
+
id: 766165,
|
|
48
|
+
artist: 'aaronmusslewhite',
|
|
49
|
+
artistId: 2130,
|
|
50
|
+
fileSize: '6.1 MB',
|
|
51
|
+
link: 'http://audio.ngfiles.com/766000/766165_XO-Eden-Cover-amp-Remake.mp3'
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
+
### getProfile(user)
|
|
57
|
+
|
|
58
|
+
With this function, you can get somebody's profile info. You can use a player ID (not the account ID) or a name string, it doesn't matter.
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
const gd = require("gj-boomlings-api");
|
|
62
|
+
gd.getProfile(16).then(console.log);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Returns:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
{
|
|
69
|
+
username: 'RobTop',
|
|
70
|
+
playerID: 16,
|
|
71
|
+
accountID: 71,
|
|
72
|
+
rank: 219796,
|
|
73
|
+
stars: 2375,
|
|
74
|
+
diamonds: 2170,
|
|
75
|
+
secretCoins: 3,
|
|
76
|
+
userCoins: 140,
|
|
77
|
+
demons: 5,
|
|
78
|
+
creatorPoints: 0,
|
|
79
|
+
messages: 'none',
|
|
80
|
+
friendRequests: 'none',
|
|
81
|
+
commentHistory: 'all',
|
|
82
|
+
mod: 'elder',
|
|
83
|
+
youtube: 'https://youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw1231',
|
|
84
|
+
twitter: 'https://twitter.com/RobTopGames',
|
|
85
|
+
twitch: 'https://twitch.tv/robtopgames'
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
56
89
|
### getSongInfo(song)
|
|
57
90
|
|
|
58
|
-
With this function, you can get an info about a custom song by its ID (
|
|
91
|
+
With this function, you can get an info about a custom song by its ID (but only if it's on Newgrounds).
|
|
59
92
|
|
|
60
93
|
```js
|
|
61
94
|
const gd = require("gj-boomlings-api");
|
package/functions/dlLevel.js
CHANGED
|
@@ -14,7 +14,7 @@ module.exports = {
|
|
|
14
14
|
gameVersion: 21,
|
|
15
15
|
binaryVersion: 35,
|
|
16
16
|
gdw: 0,
|
|
17
|
-
levelID: level,
|
|
17
|
+
levelID: level.trim(),
|
|
18
18
|
secret: "Wmfd2893gb7"
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -23,7 +23,7 @@ module.exports = {
|
|
|
23
23
|
})
|
|
24
24
|
|
|
25
25
|
if(res.data == -1) throw new Error("-1 Not found.")
|
|
26
|
-
if(res.data == "
|
|
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
27
|
let split1 = res.data.split("1:")[1]; // id
|
|
28
28
|
let split2 = res.data.split(":2:")[1]; // name
|
|
29
29
|
let split3 = res.data.split(":3:")[1]; // description
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
getLevelData:
|
|
3
3
|
function(level, log = false) {
|
|
4
|
+
if(!level) throw new Error("Please provide a level ID.");
|
|
4
5
|
if(typeof level === "string") throw new Error("The level parameter should be a number.");
|
|
5
6
|
const axios = require("axios");
|
|
6
7
|
const { headers } = require("../config.json");
|
|
@@ -19,7 +20,7 @@ module.exports = {
|
|
|
19
20
|
}).then(res => {
|
|
20
21
|
|
|
21
22
|
if(res.data == -1) throw new Error("-1 Not found.")
|
|
22
|
-
if(res.data == "
|
|
23
|
+
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).")
|
|
23
24
|
|
|
24
25
|
let levelData = res.data.split(":4:")[1].split(":5:")[0]
|
|
25
26
|
if(log == true) console.log(levelData);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
getOfficialSongInfo:
|
|
3
3
|
function(song) {
|
|
4
|
-
if(
|
|
4
|
+
if(!song) throw new Error("Please provide a song ID.");
|
|
5
|
+
if(isNaN(song)) throw new Error("A song ID must be a number.");
|
|
5
6
|
const {
|
|
6
7
|
sm,
|
|
7
8
|
bot,
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getProfile:
|
|
3
|
+
async function(str) {
|
|
4
|
+
if(!str) throw new Error("Please provide a user ID or name!");
|
|
5
|
+
const axios = require("axios");
|
|
6
|
+
const { headers } = require("../config.json");
|
|
7
|
+
|
|
8
|
+
const data = {
|
|
9
|
+
gameVersion: 21,
|
|
10
|
+
binaryVersion: 35,
|
|
11
|
+
gdw: 0,
|
|
12
|
+
str: str,
|
|
13
|
+
secret: "Wmfd2893gb7"
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
let r = await axios.post("http://www.boomlings.com/database/getGJUsers20.php", data, {
|
|
17
|
+
headers: headers
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
let id = r.data.split(":16:")[1].split(":3:")[0];
|
|
21
|
+
if(Number(id) < 71 || id.includes(":")) id = r.data.split(":16:")[2].split(":3:")[0];
|
|
22
|
+
|
|
23
|
+
let GJUI20data = {
|
|
24
|
+
gameVersion: 21,
|
|
25
|
+
binaryVersion: 35,
|
|
26
|
+
gdw: 0,
|
|
27
|
+
targetAccountID: id,
|
|
28
|
+
secret: "Wmfd2893gb7"
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
let res = await axios.post("http://www.boomlings.com/database/getGJUserInfo20.php", GJUI20data, {
|
|
32
|
+
headers: headers
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
if(res.data == -1) throw new Error("-1 Not found.")
|
|
36
|
+
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).")
|
|
37
|
+
|
|
38
|
+
let dataWoSkins = `${res.data.split("21:")[0]}${res.data.split(":48:")[1]}`;
|
|
39
|
+
|
|
40
|
+
let username = dataWoSkins.split("1:")[1].split(":2:")[0];
|
|
41
|
+
let playerID = dataWoSkins.split(":2:")[1].split(":13:")[0];
|
|
42
|
+
let goldCoins = dataWoSkins.split(":13:")[1].split(":17:")[0];
|
|
43
|
+
let silverCoins = dataWoSkins.split(":17:")[1].split(":10:")[0];
|
|
44
|
+
let stars = dataWoSkins.split(":3:")[1].split(":46:")[0];
|
|
45
|
+
let diamonds = dataWoSkins.split(":46:")[1].split(":4:")[0];
|
|
46
|
+
let demons = dataWoSkins.split(":4:")[1].split(":8:")[0];
|
|
47
|
+
let cps = dataWoSkins.split(":8:")[1].split(":18:")[0]; // clicks per second lmao
|
|
48
|
+
let msgState = dataWoSkins.split(":18:")[1].split(":19:")[0];
|
|
49
|
+
let friendsState = dataWoSkins.split(":19:")[1].split(":50:")[0];
|
|
50
|
+
let commentHistoryState = dataWoSkins.split(":50:")[1].split(":20:")[0];
|
|
51
|
+
let youtube = dataWoSkins.split(":20:")[1].split(":")[0];
|
|
52
|
+
let rank = dataWoSkins.split(":30:")[1].split(":16:")[0];
|
|
53
|
+
let accountID = dataWoSkins.split(":16:")[1].split(":31:")[0];
|
|
54
|
+
let twitter = dataWoSkins.split(":44:")[1].split(":45:")[0];
|
|
55
|
+
let twitch = dataWoSkins.split(":45:")[1].split(":49:")[0];
|
|
56
|
+
let modState = dataWoSkins.split(":49:")[1].split(":29:")[0];
|
|
57
|
+
|
|
58
|
+
if(youtube.includes(":")) youtube = dataWoSkins.split(":20:")[1].split(":")[0];
|
|
59
|
+
if(twitter.includes(":")) twitter = dataWoSkins.split(":44:")[2].split(":45:")[0];
|
|
60
|
+
if(twitch.includes(":")) twitch = dataWoSkins.split(":45:")[2].split(":49:")[0];
|
|
61
|
+
if(goldCoins.includes(":")) goldCoins = dataWoSkins.split(":13:")[2].split(":17:")[0];
|
|
62
|
+
if(goldCoins == "") goldCoins = dataWoSkins.split(":13:")[1].split(":17:")[1];
|
|
63
|
+
if(silverCoins.includes(":")) silverCoins = dataWoSkins.split("17:")[2].split(":10:")[0];
|
|
64
|
+
if(rank.includes(":")) rank = dataWoSkins.split(":30:")[2].split(":16:")[0];
|
|
65
|
+
if(accountID.includes(":")) accountID = dataWoSkins.split(":16:")[2].split(":31:")[0];
|
|
66
|
+
if(demons.includes(":")) demons = dataWoSkins.split(":4:")[2].split(":8:")[0];
|
|
67
|
+
if(msgState.includes(":")) msgState = dataWoSkins.split(":18:")[2].split(":19:")[0];
|
|
68
|
+
if(stars.includes(":")) stars = dataWoSkins.split("3:")[2].split(":46:")[0];
|
|
69
|
+
if(modState.includes(":")) modState = dataWoSkins.split(":49:")[2].split(":29:")[0];
|
|
70
|
+
if(dataWoSkins.split(":3:")[1].split(":46:")[0].startsWith("3:")) stars = dataWoSkins.split(":3:")[1].split("3:")[1].split(":46:")[0];
|
|
71
|
+
if(dataWoSkins.split("3:")[2].split(":46:")[0].includes(":")) {
|
|
72
|
+
stars = dataWoSkins.split("3:")[3].split(":46:")[0];
|
|
73
|
+
} else {
|
|
74
|
+
stars = stars;
|
|
75
|
+
}
|
|
76
|
+
if(dataWoSkins.split("3:")[3] != undefined || dataWoSkins.split("3:")[3] != "") {
|
|
77
|
+
if(dataWoSkins.split("3:")[3].split(":46:")[0] == "") {
|
|
78
|
+
stars = dataWoSkins.split("3:")[4].split(":46:")[0];
|
|
79
|
+
} else {
|
|
80
|
+
stars = stars;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let ytLnk = `htps://youtube.com/channel/${youtube}`;
|
|
85
|
+
let twitterLnk = `https://twitter.com/${twitter}`;
|
|
86
|
+
let twitchLnk = `https://twitch.tv/${twitch}`;
|
|
87
|
+
|
|
88
|
+
if(youtube == "") ytLnk = null;
|
|
89
|
+
if(twitter == "") twitterLnk = null;
|
|
90
|
+
if(twitch == "") twitchLnk = null;
|
|
91
|
+
if(youtube.endsWith("123")) ytLnk = `https://youtube.com/channel/${youtube.split("123")[0]}`;
|
|
92
|
+
if(twitter.endsWith("123")) twitterLnk = `https://twitter.com/${twitter.split("123")[0]}`;
|
|
93
|
+
if(twitch.endsWith("123")) twitchLnk = `https://twitch.tv/${twitch.split("123")[0]}`;
|
|
94
|
+
|
|
95
|
+
let msgStateDecoding = {
|
|
96
|
+
"0": "all",
|
|
97
|
+
"1": "friends",
|
|
98
|
+
"2": "none"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
let stateBinaryDecoding = {
|
|
102
|
+
"0": "all",
|
|
103
|
+
"1": "none"
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
let modDecoding = {
|
|
107
|
+
"0": "none",
|
|
108
|
+
"1": "mod",
|
|
109
|
+
"2": "elder"
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const result = {
|
|
113
|
+
username: username,
|
|
114
|
+
playerID: Number(playerID),
|
|
115
|
+
accountID: Number(accountID),
|
|
116
|
+
rank: Number(rank),
|
|
117
|
+
stars: Number(stars),
|
|
118
|
+
diamonds: Number(diamonds),
|
|
119
|
+
secretCoins: Number(goldCoins),
|
|
120
|
+
userCoins: Number(silverCoins),
|
|
121
|
+
demons: Number(demons),
|
|
122
|
+
creatorPoints: Number(cps),
|
|
123
|
+
messages: msgStateDecoding[msgState],
|
|
124
|
+
friendRequests: stateBinaryDecoding[friendsState],
|
|
125
|
+
commentHistory: msgStateDecoding[commentHistoryState],
|
|
126
|
+
mod: modDecoding[modState],
|
|
127
|
+
youtube: ytLnk,
|
|
128
|
+
twitter: twitterLnk,
|
|
129
|
+
twitch: twitchLnk
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
}
|
package/functions/getSongInfo.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
getSongInfo:
|
|
3
3
|
async function(song) {
|
|
4
|
-
if(
|
|
4
|
+
if(!song) throw new Error("Please provide a song ID.");
|
|
5
|
+
if(isNaN(song)) throw new Error("A song ID must be a number.")
|
|
5
6
|
const axios = require("axios")
|
|
6
7
|
const {headers} = require("../config.json")
|
|
7
8
|
|
|
@@ -15,7 +16,7 @@ module.exports = {
|
|
|
15
16
|
})
|
|
16
17
|
|
|
17
18
|
if(res.data == -2) throw new Error(`-2. Couldn't find a song with ID ${song}.`)
|
|
18
|
-
if(res.data == "
|
|
19
|
+
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).")
|
|
19
20
|
|
|
20
21
|
const result = {
|
|
21
22
|
"name": res.data.split("|~2~|~")[1].split("~|~3~|~")[0],
|
package/index.js
CHANGED
|
@@ -6,6 +6,7 @@ const { decURLSafeBase64 } = require("./functions/decURLSafeBase64.js");
|
|
|
6
6
|
const { encURLSafeBase64 } = require("./functions/encURLSafeBase64.js");
|
|
7
7
|
const { getDailyLevel } = require("./functions/getDailyLevel.js");
|
|
8
8
|
const { getWeeklyDemon } = require("./functions/getWeeklyDemon.js");
|
|
9
|
+
const { getProfile } = require("./functions/getProfile.js");
|
|
9
10
|
|
|
10
11
|
module.exports.dlLevel = dlLevel;
|
|
11
12
|
module.exports.getLevelData = getLevelData;
|
|
@@ -14,4 +15,7 @@ module.exports.getOfficialSongInfo = getOfficialSongInfo;
|
|
|
14
15
|
module.exports.decURLSafeBase64 = decURLSafeBase64;
|
|
15
16
|
module.exports.encURLSafeBase64 = encURLSafeBase64;
|
|
16
17
|
module.exports.getDailyLevel = getDailyLevel;
|
|
17
|
-
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
18
|
+
module.exports.getWeeklyDemon = getWeeklyDemon;
|
|
19
|
+
module.exports.getProfile = getProfile;
|
|
20
|
+
|
|
21
|
+
dlLevel("58825144").then(console.log)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gj-boomlings-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "A Node.js module that allows you to fetch boomlings.com easily",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
"url": "https://github.com/shikoshib/gj-boomlings-api/issues"
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://github.com/shikoshib/gj-boomlings-api",
|
|
19
|
+
"keywords": [
|
|
20
|
+
"geometrydash",
|
|
21
|
+
"gd",
|
|
22
|
+
"gj",
|
|
23
|
+
"boomlings",
|
|
24
|
+
"api",
|
|
25
|
+
"gaming"
|
|
26
|
+
],
|
|
19
27
|
"license": "ISC",
|
|
20
28
|
"dependencies": {
|
|
21
29
|
"axios": "^1.2.1",
|
package/t.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1:Ivav12:2:134186837:13:4:17:0:10:12:11:9:3:142:46:9:4:13:8:3:18:0:19:0:50:0:20::21:26:22:32:23:10:24:6:25:15:26:24:28:0:43:15:48:1:30:0:16:13768920:31:0:44::45::49:0:29:1
|