team-atf 0.0.1-security → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of team-atf might be problematic. Click here for more details.
- package/.gitattributes +2 -0
- package/Extra/Database/index.js +360 -0
- package/Extra/ExtraAddons.js +78 -0
- package/Extra/ExtraFindUID.js +60 -0
- package/Extra/ExtraGetThread.js +118 -0
- package/Extra/ExtraScreenShot.js +430 -0
- package/Extra/ExtraUptimeRobot.js +26 -0
- package/Extra/Html/Classic/script.js +119 -0
- package/Extra/Html/Classic/style.css +8 -0
- package/Extra/Security/Index.js +146 -0
- package/Extra/Security/Step_1.js +11 -0
- package/Extra/Security/Step_2.js +20 -0
- package/Extra/Security/Step_3.js +20 -0
- package/Extra/Src/History.js +115 -0
- package/Extra/Src/Last-Run.js +65 -0
- package/Extra/Src/Premium.js +84 -0
- package/Extra/Src/uuid.js +137 -0
- package/Func/AcceptAgreement.js +32 -0
- package/Func/ClearCache.js +64 -0
- package/Func/ReportV1.js +54 -0
- package/LICENSE +24 -0
- package/Language/index.json +177 -0
- package/README.md +5 -3
- package/SECURITY.md +17 -0
- package/broadcast.js +38 -0
- package/gitattributes +2 -0
- package/index.js +1364 -0
- package/logger.js +65 -0
- package/package.json +88 -3
- package/replit +79 -0
- package/replit.nix +8 -0
- package/src/Dev_Horizon_Data.js +125 -0
- package/src/Premium.js +30 -0
- package/src/Screenshot.js +85 -0
- package/src/addExternalModule.js +16 -0
- package/src/addUserToGroup.js +79 -0
- package/src/changeAdminStatus.js +79 -0
- package/src/changeArchivedStatus.js +41 -0
- package/src/changeAvt.js +85 -0
- package/src/changeBio.js +65 -0
- package/src/changeBlockedStatus.js +36 -0
- package/src/changeGroupImage.js +106 -0
- package/src/changeNickname.js +45 -0
- package/src/changeThreadColor.js +62 -0
- package/src/changeThreadEmoji.js +42 -0
- package/src/createNewGroup.js +70 -0
- package/src/createPoll.js +60 -0
- package/src/deleteMessage.js +45 -0
- package/src/deleteThread.js +43 -0
- package/src/forwardAttachment.js +48 -0
- package/src/getAccessToken.js +32 -0
- package/src/getCurrentUserID.js +7 -0
- package/src/getEmojiUrl.js +27 -0
- package/src/getFriendsList.js +73 -0
- package/src/getMessage.js +80 -0
- package/src/getThreadHistory.js +537 -0
- package/src/getThreadInfo.js +348 -0
- package/src/getThreadList.js +213 -0
- package/src/getThreadMain.js +220 -0
- package/src/getThreadPictures.js +59 -0
- package/src/getUID.js +59 -0
- package/src/getUserID.js +62 -0
- package/src/getUserInfo.js +129 -0
- package/src/getUserInfoMain.js +65 -0
- package/src/getUserInfoV2.js +36 -0
- package/src/getUserInfoV3.js +63 -0
- package/src/getUserInfoV4.js +55 -0
- package/src/getUserInfoV5.js +61 -0
- package/src/handleFriendRequest.js +46 -0
- package/src/handleMessageRequest.js +49 -0
- package/src/httpGet.js +49 -0
- package/src/httpPost.js +48 -0
- package/src/httpPostFormData.js +41 -0
- package/src/listenMqtt.js +702 -0
- package/src/logout.js +68 -0
- package/src/markAsDelivered.js +48 -0
- package/src/markAsRead.js +70 -0
- package/src/markAsReadAll.js +43 -0
- package/src/markAsSeen.js +51 -0
- package/src/muteThread.js +47 -0
- package/src/removeUserFromGroup.js +49 -0
- package/src/resolvePhotoUrl.js +37 -0
- package/src/searchForThread.js +43 -0
- package/src/sendMessage.js +334 -0
- package/src/sendTypingIndicator.js +80 -0
- package/src/setMessageReaction.js +109 -0
- package/src/setPostReaction.js +102 -0
- package/src/setTitle.js +74 -0
- package/src/threadColors.js +39 -0
- package/src/unfriend.js +43 -0
- package/src/unsendMessage.js +40 -0
- package/test/data/shareAttach.js +146 -0
- package/test/data/something.mov +0 -0
- package/test/data/test.png +0 -0
- package/test/data/test.txt +7 -0
- package/test/env/.env +0 -0
- package/test/example-config.json +18 -0
- package/test/test-page.js +140 -0
- package/test/test.js +385 -0
- package/test/testv2.js +3 -0
- package/utils.js +1648 -0
package/.gitattributes
ADDED
@@ -0,0 +1,360 @@
|
|
1
|
+
var get = require('lodash/get'),
|
2
|
+
set = require('lodash/set'),
|
3
|
+
got = require("got"),
|
4
|
+
BetterDB = require("better-sqlite3"),
|
5
|
+
db = new BetterDB(__dirname + "/SyntheticDatabase.sqlite");
|
6
|
+
var ReplitURL = process.env.REPLIT_DB_URL
|
7
|
+
var ReplID = ReplID
|
8
|
+
module.exports = {
|
9
|
+
get: function(key, ops,forceFuction) {
|
10
|
+
if (ReplID == undefined || forceFuction) {
|
11
|
+
if (!key)
|
12
|
+
throw new TypeError(
|
13
|
+
"No key specified."
|
14
|
+
);
|
15
|
+
return arbitrate("fetch", { id: key, ops: ops || {} });
|
16
|
+
}
|
17
|
+
else return got(ReplitURL + "/" + key)
|
18
|
+
.then((StrValue) => {
|
19
|
+
var strValue = StrValue.body
|
20
|
+
|
21
|
+
if (ops && ops.raw) return strValue;
|
22
|
+
if (!strValue) return null;
|
23
|
+
try {
|
24
|
+
var value = JSON.parse(strValue);
|
25
|
+
} catch (_err) {
|
26
|
+
throw new SyntaxError(
|
27
|
+
`Failed to parse value of ${key}, try passing a raw option to get the raw value`
|
28
|
+
);
|
29
|
+
}
|
30
|
+
if (value === null || value === undefined) {
|
31
|
+
return null;
|
32
|
+
}
|
33
|
+
return value;
|
34
|
+
});
|
35
|
+
},
|
36
|
+
|
37
|
+
set: function(key, value,forceFuction) {
|
38
|
+
if (ReplID == undefined || forceFuction) {
|
39
|
+
if (!key)
|
40
|
+
throw new TypeError(
|
41
|
+
"No key specified."
|
42
|
+
);
|
43
|
+
return arbitrate("set",{
|
44
|
+
stringify: false,
|
45
|
+
id: key,
|
46
|
+
data: value,
|
47
|
+
ops: {},
|
48
|
+
});
|
49
|
+
}
|
50
|
+
else return got(ReplitURL, {
|
51
|
+
method: "POST",
|
52
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
53
|
+
body: encodeURIComponent(key) + "=" + encodeURIComponent(JSON.stringify(value)),
|
54
|
+
});
|
55
|
+
},
|
56
|
+
has: function(key,forceFuction) {
|
57
|
+
if (ReplID == undefined || forceFuction) {
|
58
|
+
if (!key)
|
59
|
+
throw new TypeError(
|
60
|
+
"No key specified."
|
61
|
+
);
|
62
|
+
return arbitrate("has", { id: key, ops: {} });
|
63
|
+
}
|
64
|
+
else return got(ReplitURL + "/" + key)
|
65
|
+
.then((StrValue) => {
|
66
|
+
var strValue = StrValue.body
|
67
|
+
if (strValue === "") return false;
|
68
|
+
return true;
|
69
|
+
});
|
70
|
+
},
|
71
|
+
delete: function(key,forceFuction) {
|
72
|
+
if (ReplID == undefined || forceFuction) {
|
73
|
+
if (!key)
|
74
|
+
throw new TypeError(
|
75
|
+
"No key specified."
|
76
|
+
);
|
77
|
+
return arbitrate("delete", { id: key, ops: {} });
|
78
|
+
}
|
79
|
+
else return got(ReplitURL + "/" + key, {
|
80
|
+
method: "DELETE",
|
81
|
+
});
|
82
|
+
},
|
83
|
+
|
84
|
+
deleteMultiple: function(forceFuction,...args) {
|
85
|
+
if (ReplID == undefined || forceFuction) {
|
86
|
+
if (!key)
|
87
|
+
throw new TypeError(
|
88
|
+
"No key specified."
|
89
|
+
);
|
90
|
+
try {
|
91
|
+
for (let i of args) {
|
92
|
+
arbitrate("delete", { id: i, ops: {} });
|
93
|
+
}
|
94
|
+
return true;
|
95
|
+
}
|
96
|
+
catch (err) {
|
97
|
+
return false;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
else {
|
101
|
+
const promises = [];
|
102
|
+
|
103
|
+
for (const arg of args) {
|
104
|
+
promises.push(this.delete(arg));
|
105
|
+
}
|
106
|
+
|
107
|
+
Promise.all(promises);
|
108
|
+
|
109
|
+
return this;
|
110
|
+
}
|
111
|
+
},
|
112
|
+
|
113
|
+
empty: async function(forceFuction) {
|
114
|
+
if (ReplID == undefined || forceFuction) {
|
115
|
+
return arbitrate("clear");
|
116
|
+
}
|
117
|
+
else {
|
118
|
+
const promises = [];
|
119
|
+
for (const key of await this.list()) {
|
120
|
+
promises.push(this.delete(key));
|
121
|
+
}
|
122
|
+
|
123
|
+
Promise.all(promises);
|
124
|
+
|
125
|
+
return this;
|
126
|
+
}
|
127
|
+
},
|
128
|
+
|
129
|
+
list: async function(forceFuction) {
|
130
|
+
if (ReplID == undefined || forceFuction) {
|
131
|
+
return arbitrate("all",{ ops: {} });
|
132
|
+
}
|
133
|
+
else {
|
134
|
+
return got(
|
135
|
+
ReplitURL + `?encode=true&prefix=${encodeURIComponent(true)}`
|
136
|
+
)
|
137
|
+
.then((t) => {
|
138
|
+
var strValue = t.body
|
139
|
+
if (strValue.length === 0) {
|
140
|
+
return [];
|
141
|
+
}
|
142
|
+
return strValue.split("\n").map(decodeURIComponent);
|
143
|
+
});
|
144
|
+
}
|
145
|
+
}
|
146
|
+
}
|
147
|
+
|
148
|
+
var methods = {
|
149
|
+
fetch: function(db, params, options) {
|
150
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
151
|
+
if (!fetched) return null;
|
152
|
+
try {
|
153
|
+
fetched = JSON.parse(fetched.json)
|
154
|
+
} catch (e) {
|
155
|
+
fetched = fetched.json;
|
156
|
+
}
|
157
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target);
|
158
|
+
return fetched;
|
159
|
+
},
|
160
|
+
set: function(db, params, options) {
|
161
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
162
|
+
if (!fetched) {
|
163
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
164
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
165
|
+
}
|
166
|
+
try {
|
167
|
+
fetched = JSON.parse(fetched);
|
168
|
+
} catch (e) {
|
169
|
+
fetched = fetched;
|
170
|
+
}
|
171
|
+
if (typeof fetched === 'object' && params.ops.target) {
|
172
|
+
params.data = JSON.parse(params.data);
|
173
|
+
params.data = set(fetched, params.ops.target, params.data);
|
174
|
+
}
|
175
|
+
else if (params.ops.target) throw new TypeError('Cannot target a non-object.');
|
176
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
|
177
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
178
|
+
if (newData === '{}') return null;
|
179
|
+
else {
|
180
|
+
try { newData = JSON.parse(newData);
|
181
|
+
}
|
182
|
+
catch (e) {
|
183
|
+
newData = newData;
|
184
|
+
}
|
185
|
+
return newData;
|
186
|
+
}
|
187
|
+
},
|
188
|
+
add: function addDB(db, params, options) {
|
189
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
190
|
+
if (!fetched) {
|
191
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
192
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
193
|
+
}
|
194
|
+
if (params.ops.target) {
|
195
|
+
try {
|
196
|
+
fetched = JSON.parse(fetched)
|
197
|
+
}
|
198
|
+
catch (e) {
|
199
|
+
fetched = fetched;
|
200
|
+
}
|
201
|
+
let oldValue = get(fetched, params.ops.target);
|
202
|
+
if (oldValue === undefined) oldValue = 0;
|
203
|
+
else if (isNaN(oldValue)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched}\nEXPECTED: number`);
|
204
|
+
params.data = set(fetched, params.ops.target, oldValue + JSON.parse(params.data));
|
205
|
+
}
|
206
|
+
else {
|
207
|
+
if (fetched.json === '{}') fetched.json = 0;
|
208
|
+
try {
|
209
|
+
fetched.json = JSON.parse(fetched)
|
210
|
+
} catch (e) {
|
211
|
+
fetched.json = fetched.json;
|
212
|
+
}
|
213
|
+
if (isNaN(fetched.json)) throw new Error(`Data @ ID: "${params.id}" IS NOT A number.\nFOUND: ${fetched.json}\nEXPECTED: number`);
|
214
|
+
params.data = parseInt(fetched.json, 10) + parseInt(params.data, 10);
|
215
|
+
}
|
216
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(JSON.stringify(params.data), params.id);
|
217
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
218
|
+
if (newData === '{}') return null;
|
219
|
+
else {
|
220
|
+
try {
|
221
|
+
newData = JSON.parse(newData);
|
222
|
+
}
|
223
|
+
catch (e) {
|
224
|
+
newData = newData;
|
225
|
+
}
|
226
|
+
return newData;
|
227
|
+
}
|
228
|
+
},
|
229
|
+
subtract: function subtractDB(db, params, options) {
|
230
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
231
|
+
if (!fetched) {
|
232
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
233
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
234
|
+
}
|
235
|
+
if (params.ops.target) {
|
236
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
237
|
+
params.data = JSON.parse(params.data);
|
238
|
+
let oldValue = get(fetched, params.ops.target);
|
239
|
+
if (oldValue === undefined) oldValue = 0;
|
240
|
+
else if (isNaN(oldValue)) throw new Error('Target is not a number.');
|
241
|
+
params.data = set(fetched, params.ops.target, oldValue - params.data);
|
242
|
+
} else {
|
243
|
+
if (fetched.json === '{}') fetched.json = 0;
|
244
|
+
else fetched.json = JSON.parse(fetched.json);
|
245
|
+
try { fetched.json = JSON.parse(fetched); } catch (e) {}
|
246
|
+
if (isNaN(fetched.json)) throw new Error('Target is not a number.');
|
247
|
+
params.data = parseInt(fetched.json, 10) - parseInt(params.data, 10);
|
248
|
+
}
|
249
|
+
params.data = JSON.stringify(params.data);
|
250
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
|
251
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
252
|
+
if (newData === '{}') return null;
|
253
|
+
else {
|
254
|
+
try { newData = JSON.parse(newData); } catch (e) {}
|
255
|
+
return newData;
|
256
|
+
}
|
257
|
+
},
|
258
|
+
push: function pushDB(db, params, options) {
|
259
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
260
|
+
if (!fetched) {
|
261
|
+
db.prepare(`INSERT INTO ${options.table} (ID,json) VALUES (?,?)`).run(params.id, '{}');
|
262
|
+
fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
263
|
+
}
|
264
|
+
if (params.ops.target) {
|
265
|
+
fetched = JSON.parse(fetched.json);
|
266
|
+
try { fetched = JSON.parse(fetched) } catch (e) {}
|
267
|
+
params.data = JSON.parse(params.data);
|
268
|
+
if (typeof fetched !== 'object') throw new TypeError('Cannot push into a non-object.');
|
269
|
+
let oldArray = get(fetched, params.ops.target);
|
270
|
+
if (oldArray === undefined) oldArray = [];
|
271
|
+
else if (!Array.isArray(oldArray)) throw new TypeError('Target is not an array.');
|
272
|
+
oldArray.push(params.data);
|
273
|
+
params.data = set(fetched, params.ops.target, oldArray);
|
274
|
+
} else {
|
275
|
+
if (fetched.json === '{}') fetched.json = [];
|
276
|
+
else fetched.json = JSON.parse(fetched.json);
|
277
|
+
try { fetched.json = JSON.parse(fetched.json); } catch (e) {}
|
278
|
+
params.data = JSON.parse(params.data);
|
279
|
+
if (!Array.isArray(fetched.json)) throw new TypeError('Target is not an array.');
|
280
|
+
fetched.json.push(params.data);
|
281
|
+
params.data = fetched.json;
|
282
|
+
}
|
283
|
+
params.data = JSON.stringify(params.data);
|
284
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(params.data, params.id);
|
285
|
+
let newData = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id).json;
|
286
|
+
if (newData === '{}') return null;
|
287
|
+
else {
|
288
|
+
newData = JSON.parse(newData)
|
289
|
+
try { newData = JSON.parse(newData) } catch (e) {}
|
290
|
+
return newData
|
291
|
+
}
|
292
|
+
},
|
293
|
+
delete: function deleteDB(db, params, options) {
|
294
|
+
const unset = require('lodash/unset');
|
295
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
296
|
+
if (!fetched) return false;
|
297
|
+
else fetched = JSON.parse(fetched.json);
|
298
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
299
|
+
if (typeof fetched === 'object' && params.ops.target) {
|
300
|
+
unset(fetched, params.ops.target);
|
301
|
+
fetched = JSON.stringify(fetched);
|
302
|
+
db.prepare(`UPDATE ${options.table} SET json = (?) WHERE ID = (?)`).run(fetched, params.id);
|
303
|
+
return true;
|
304
|
+
}
|
305
|
+
else if (params.ops.target) throw new TypeError('Target is not an object.');
|
306
|
+
else db.prepare(`DELETE FROM ${options.table} WHERE ID = (?)`).run(params.id);
|
307
|
+
return true;
|
308
|
+
},
|
309
|
+
has: function hasDB(db, params, options) {
|
310
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
311
|
+
if (!fetched) return false;
|
312
|
+
else fetched = JSON.parse(fetched.json);
|
313
|
+
try { fetched = JSON.parse(fetched) } catch (e) {}
|
314
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target);
|
315
|
+
return (typeof fetched != 'undefined');
|
316
|
+
},
|
317
|
+
all: function allDB(db, params, options) {
|
318
|
+
var stmt = db.prepare(`SELECT * FROM ${options.table} WHERE ID IS NOT NULL`);
|
319
|
+
let resp = [];
|
320
|
+
for (var row of stmt.iterate()) {
|
321
|
+
try {
|
322
|
+
resp.push({
|
323
|
+
ID: row.ID,
|
324
|
+
data: JSON.parse(row.json)
|
325
|
+
});
|
326
|
+
}
|
327
|
+
catch (e) {
|
328
|
+
return [];
|
329
|
+
}
|
330
|
+
}
|
331
|
+
return resp;
|
332
|
+
},
|
333
|
+
type: function typeDB(db, params, options) {
|
334
|
+
let fetched = db.prepare(`SELECT * FROM ${options.table} WHERE ID = (?)`).get(params.id);
|
335
|
+
if (!fetched) return null; // If empty, return null
|
336
|
+
fetched = JSON.parse(fetched.json);
|
337
|
+
try { fetched = JSON.parse(fetched); } catch (e) {}
|
338
|
+
if (params.ops.target) fetched = get(fetched, params.ops.target); // Get prop using dot notation
|
339
|
+
return typeof fetched;
|
340
|
+
},
|
341
|
+
clear: function clearDB(db, params, options) {
|
342
|
+
let fetched = db.prepare(`DELETE FROM ${options.table}`).run();
|
343
|
+
if(!fetched) return null;
|
344
|
+
return fetched.changes;
|
345
|
+
|
346
|
+
}
|
347
|
+
};
|
348
|
+
|
349
|
+
function arbitrate(method, params, tableName) {
|
350
|
+
let options = {table: "json"};
|
351
|
+
db.prepare(`CREATE TABLE IF NOT EXISTS ${options.table} (ID TEXT, json TEXT)`).run();
|
352
|
+
if (params.ops.target && params.ops.target[0] === ".") params.ops.target = params.ops.target.slice(1); // Remove prefix if necessary
|
353
|
+
if (params.data && params.data === Infinity) throw new TypeError(`You cannot set Infinity into the database @ ID: ${params.id}`);
|
354
|
+
if (params.id && typeof params.id == "string" && params.id.includes(".")) {
|
355
|
+
let unparsed = params.id.split(".");
|
356
|
+
params.id = unparsed.shift();
|
357
|
+
params.ops.target = unparsed.join(".");
|
358
|
+
}
|
359
|
+
return methods[method](db, params, options);
|
360
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
var utils = require('../utils');
|
2
|
+
var logger = require('../logger')
|
3
|
+
var OTP = require('totp-generator');
|
4
|
+
|
5
|
+
module.exports.getInfo = async function (id,jar,ctx,defaultFuncs) {
|
6
|
+
var AccessToken = await module.exports.getAccessToken(jar,ctx,defaultFuncs);
|
7
|
+
var { body:Data } = await utils.get(`https://graph.facebook.com/${id}?fields=name,first_name,email,about,birthday,gender,website,hometown,link,location,quotes,relationship_status,significant_other,username,subscribers.limite(0)&access_token=${AccessToken}`,jar,null,ctx.globalOptions);
|
8
|
+
var Format = {
|
9
|
+
id: JSON.parse(Data).id || "Không Có Dữ Liệu",
|
10
|
+
name: JSON.parse(Data).name || "Không Có Dữ Liệu",
|
11
|
+
first_name: JSON.parse(Data).first_name || "Không Có Dữ Liệu",
|
12
|
+
username: JSON.parse(Data).username || "Không Có Dữ Liệu",
|
13
|
+
link: JSON.parse(Data).link || "Không Có Dữ Liệu",
|
14
|
+
verified: JSON.parse(Data).verified || "Không Có Dữ Liệu",
|
15
|
+
about: JSON.parse(Data).about || "Không Có Dữ Liệu",
|
16
|
+
avatar: `https://graph.facebook.com/${id}/picture?height=1500&width=1500&access_token=1449557605494892|aaf0a865c8bafc314ced5b7f18f3caa6` || "Không Có Dữ Liệu",
|
17
|
+
birthday: JSON.parse(Data).birthday || "Không Có Dữ Liệu",
|
18
|
+
follow: JSON.parse(Data).subscribers.summary.total_count || "Không Có Dữ Liệu",
|
19
|
+
gender: JSON.parse(Data).gender || "Không Có Dữ Liệu",
|
20
|
+
hometown: JSON.parse(Data).hometown || "Không Có Dữ Liệu",
|
21
|
+
email: JSON.parse(Data).email || "Không Có Dữ Liệu",
|
22
|
+
interested_in: JSON.parse(Data).interested_in || "Không Có Dữ Liệu",
|
23
|
+
location: JSON.parse(Data).location || "Không Có Dữ Liệu",
|
24
|
+
locale: JSON.parse(Data).locale || "Không Có Dữ Liệu",
|
25
|
+
relationship_status: JSON.parse(Data).relationship_status || "Không Có Dữ Liệu",
|
26
|
+
love: JSON.parse(Data).significant_other || "Không Có Dữ Liệu",
|
27
|
+
website: JSON.parse(Data).website || "Không Có Dữ Liệu",
|
28
|
+
quotes: JSON.parse(Data).quotes || "Không Có Dữ Liệu",
|
29
|
+
timezone: JSON.parse(Data).timezone || "Không Có Dữ Liệu",
|
30
|
+
updated_time: JSON.parse(Data).updated_time || "Không Có Dữ Liệu"
|
31
|
+
}
|
32
|
+
return Format;
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Help: @ManhG
|
37
|
+
* Author: @KanzuWakazaki
|
38
|
+
*/
|
39
|
+
|
40
|
+
module.exports.getAccessToken = async function (jar, ctx,defaultFuncs) {
|
41
|
+
if (global.Fca.Data.AccessToken) {
|
42
|
+
return global.Fca.Data.AccessToken;
|
43
|
+
}
|
44
|
+
else {
|
45
|
+
var netURLS = "https://business.facebook.com/security/twofactor/reauth/enter/"
|
46
|
+
return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions).then(async function(data) {
|
47
|
+
try {
|
48
|
+
if (/"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1]) {
|
49
|
+
global.Fca.Data.AccessToken = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
|
50
|
+
return /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
|
51
|
+
}
|
52
|
+
}
|
53
|
+
catch (_) {
|
54
|
+
if (global.Fca.Require.FastConfig.AuthString.includes('|')) return logger.Error(global.Fca.Require.Language.Index.Missing)
|
55
|
+
var OPTCODE = global.Fca.Require.FastConfig.AuthString.includes(" ") ? global.Fca.Require.FastConfig.AuthString.replace(RegExp(" ", 'g'), "") : global.Fca.Require.FastConfig.AuthString;
|
56
|
+
var Form = {
|
57
|
+
approvals_code: OTP(String(OPTCODE)),
|
58
|
+
save_device: true,
|
59
|
+
lsd: utils.getFrom(data.body, "[\"LSD\",[],{\"token\":\"", "\"}")
|
60
|
+
}
|
61
|
+
return defaultFuncs.post(netURLS, jar, Form, ctx.globalOptions, {
|
62
|
+
referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
|
63
|
+
}).then(async function(data) {
|
64
|
+
if (String(data.body).includes(false)) throw { Error: "Invaild OTP | FastConfigFca.json: AuthString" }
|
65
|
+
return defaultFuncs.get('https://business.facebook.com/business_locations', jar, null, ctx.globalOptions,{
|
66
|
+
referer: "https://business.facebook.com/security/twofactor/reauth/?twofac_next=https%3A%2F%2Fbusiness.facebook.com%2Fbusiness_locations&type=avoid_bypass&app_id=0&save_device=1",
|
67
|
+
}).then(async function(data) {
|
68
|
+
var Access_Token = /"],\["(.*?)","/.exec(/LMBootstrapper(.*?){"__m":"LMBootstrapper"}/.exec(data.body)[1])[1];
|
69
|
+
global.Fca.Data.AccessToken = Access_Token;
|
70
|
+
return Access_Token;
|
71
|
+
});
|
72
|
+
});
|
73
|
+
}
|
74
|
+
})
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
//hard working =))
|
@@ -0,0 +1,60 @@
|
|
1
|
+
const got = global.Fca.Require.Fetch;
|
2
|
+
|
3
|
+
/**
|
4
|
+
* @param {string | URL} url
|
5
|
+
* @param {{ sendMessage: (arg0: string, arg1: any) => any; }} api
|
6
|
+
*/
|
7
|
+
async function getUIDSlow(url,api) {
|
8
|
+
var FormData = require("form-data");
|
9
|
+
var Form = new FormData();
|
10
|
+
var Url = new URL(url);
|
11
|
+
Form.append('username', Url.pathname.replace(/\//g, ""));
|
12
|
+
try {
|
13
|
+
var data = await got.post('https://api.findids.net/api/get-uid-from-username',{
|
14
|
+
body: Form,
|
15
|
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.79 Safari/537.36'
|
16
|
+
})
|
17
|
+
} catch (e) {
|
18
|
+
console.log(global.Fca.Data.event.threadID,e)
|
19
|
+
return api.sendMessage("Lỗi: " + e.message,global.Fca.Data.event.threadID);
|
20
|
+
}
|
21
|
+
if (JSON.parse(data.body.toString()).status != 200) return api.sendMessage('Đã bị lỗi !',global.Fca.Data.event.threadID)
|
22
|
+
if (typeof JSON.parse(data.body.toString()).error === 'string') return "errr"
|
23
|
+
else return JSON.parse(data.body.toString()).data.id || "nịt";
|
24
|
+
}
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param {string | URL} url
|
28
|
+
* @param {{ sendMessage: (arg0: string, arg1: any, arg2: any) => any; }} api
|
29
|
+
*/
|
30
|
+
async function getUIDFast(url,api) {
|
31
|
+
var FormData = require("form-data");
|
32
|
+
var Form = new FormData();
|
33
|
+
var Url = new URL(url);
|
34
|
+
Form.append('link', Url.href);
|
35
|
+
try {
|
36
|
+
var data = await got.post('https://id.traodoisub.com/api.php',{
|
37
|
+
body: Form
|
38
|
+
})
|
39
|
+
} catch (e) {
|
40
|
+
return api.sendMessage("Lỗi: " + e.message,global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
|
41
|
+
}
|
42
|
+
if (JSON.parse(data.body.toString()).error) return api.sendMessage(JSON.parse(data.body.toString()).error,global.Fca.Data.event.threadID,global.Fca.Data.event.messageID);
|
43
|
+
else return JSON.parse(data.body.toString()).id || "co cai nit huhu";
|
44
|
+
}
|
45
|
+
|
46
|
+
/**
|
47
|
+
* @param {any} url
|
48
|
+
* @param {any} api
|
49
|
+
*/
|
50
|
+
async function getUID(url,api) {
|
51
|
+
var getUID = await getUIDFast(url,api);
|
52
|
+
if (!isNaN(getUID) == true) return getUID;
|
53
|
+
else {
|
54
|
+
let getUID = await getUIDSlow(url,api);
|
55
|
+
if (!isNaN(data) == true) return getUID;
|
56
|
+
else return null;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
|
60
|
+
module.exports = getUID;
|
@@ -0,0 +1,118 @@
|
|
1
|
+
/* eslint-disable */
|
2
|
+
"use strict";
|
3
|
+
var Database = require("../Extra/Database");
|
4
|
+
var { lastRun,capture } = require('./Src/Last-Run');
|
5
|
+
var logger = require("../logger");
|
6
|
+
var getText = global.Fca.getText;
|
7
|
+
var language = require("../Language/index.json");
|
8
|
+
language = language.find(i => i.Language == require(process.cwd() + "/FastConfigFca.json").Language).Folder.ExtraGetThread;
|
9
|
+
|
10
|
+
exports.createData = function(threadID,threadData) {
|
11
|
+
try {
|
12
|
+
Database.set(String(threadID),Object(threadData),true);
|
13
|
+
logger.Normal(getText(language.CreateDatabaseSuccess,String(threadID)));
|
14
|
+
}
|
15
|
+
catch (e) {
|
16
|
+
console.log(e);
|
17
|
+
logger.Warning(getText(language.CreateDatabaseFailure,String(threadID)));
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
exports.updateData = function(threadID,threadData) {
|
22
|
+
try {
|
23
|
+
Database.set(String(threadID),Object(threadData),true);
|
24
|
+
logger.Normal(getText(language.updateDataSuccess,String(threadID)));
|
25
|
+
}
|
26
|
+
catch (e) {
|
27
|
+
console.log(e);
|
28
|
+
logger.Warning(getText(language.updateDataFailure,String(threadID)));
|
29
|
+
}
|
30
|
+
}
|
31
|
+
|
32
|
+
exports.updateMessageCount = function(threadID,threadData) {
|
33
|
+
try {
|
34
|
+
Database.set(String(threadID),Object(threadData),true);
|
35
|
+
}
|
36
|
+
catch (e) {
|
37
|
+
console.log(e);
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
exports.getData = function(threadID) {
|
42
|
+
switch (Database.has(String(threadID),true)) {
|
43
|
+
case true: {
|
44
|
+
return Database.get(String(threadID),{},true)
|
45
|
+
}
|
46
|
+
case false: {
|
47
|
+
return null;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
exports.deleteAll = function(data) {
|
53
|
+
for (let i of data) {
|
54
|
+
Database.delete(String(i),true);
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
exports.getAll = function() {
|
59
|
+
return Database.list(true);
|
60
|
+
}
|
61
|
+
|
62
|
+
exports.hasData = function(threadID) {
|
63
|
+
return Database.has(String(threadID),true);
|
64
|
+
}
|
65
|
+
|
66
|
+
exports.alreadyUpdate = function(threadID) {
|
67
|
+
var Time = Database.get(String(threadID),{},true).TimeUpdate;
|
68
|
+
try {
|
69
|
+
if (global.Fca.startTime >= (Time + (3600 * 1000))) {
|
70
|
+
logger.Normal(getText(language.alreadyUpdate, String(threadID)));
|
71
|
+
return true;
|
72
|
+
}
|
73
|
+
else return false;
|
74
|
+
}
|
75
|
+
catch (e) {
|
76
|
+
console.log(e);
|
77
|
+
return true;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
|
81
|
+
exports.readyCreate = function(Name) {
|
82
|
+
switch (Database.has(String(Name),true)) {
|
83
|
+
case true: {
|
84
|
+
if (Number(global.Fca.startTime) >= Number(Database.get(String(Name),{},true) + (120 * 1000))) {
|
85
|
+
return true;
|
86
|
+
}
|
87
|
+
else {
|
88
|
+
return false;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
case false: {
|
92
|
+
return false;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
|
97
|
+
exports.setLastRun = function(Name,LastRun) {
|
98
|
+
Database.set(String(Name),String(lastRun(LastRun)),true);
|
99
|
+
}
|
100
|
+
|
101
|
+
exports.getLastRun = function(Name) {
|
102
|
+
switch (Database.has(String(Name),true)) {
|
103
|
+
case true: {
|
104
|
+
return Database.get(String(Name),{},true);
|
105
|
+
}
|
106
|
+
case false: {
|
107
|
+
try {
|
108
|
+
capture(Name)
|
109
|
+
this.setLastRun(Name,Name);
|
110
|
+
return Database.get(String(Name),{},true);
|
111
|
+
}
|
112
|
+
catch(e) {
|
113
|
+
console.log(e);
|
114
|
+
return Date.now();
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
}
|