meta-horizonn 1.3.3 → 1.3.6
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/Extra/Balancer.js +49 -0
- package/Language/index.json +36 -30
- package/Main.js +216 -47
- package/package.json +6 -10
- package/src/listenMqtt.js +18 -2
- package/src/unsendMessage.js +28 -19
- package/src/unsendMqttMessage.js +66 -0
- package/utils.js +25 -15
@@ -0,0 +1,49 @@
|
|
1
|
+
class APILoadBalancer {
|
2
|
+
constructor(APIV1, APIV2 , preferredRatio = 0.85, forceType2) {
|
3
|
+
this.APIV1 = APIV1;
|
4
|
+
this.APIV2 = APIV2;
|
5
|
+
this.preferredRatio = preferredRatio;
|
6
|
+
this.totalRequests = 0;
|
7
|
+
this.APIV2Requests = 0;
|
8
|
+
}
|
9
|
+
|
10
|
+
async makeRequest(requestData) {
|
11
|
+
try {
|
12
|
+
this.totalRequests++;
|
13
|
+
const currentRatio = this.APIV2Requests / this.totalRequests;
|
14
|
+
|
15
|
+
if (currentRatio < this.preferredRatio) {
|
16
|
+
this.APIV2Requests++;
|
17
|
+
return await this.APIV2(...requestData)
|
18
|
+
} else {
|
19
|
+
return await this.APIV1(...requestData);
|
20
|
+
}
|
21
|
+
} catch (error) {
|
22
|
+
return await this.fallbackRequest(requestData);
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
async fallbackRequest(requestData) {
|
27
|
+
try {
|
28
|
+
if (this.APIV2Requests / this.totalRequests >= this.preferredRatio) {
|
29
|
+
this.APIV2Requests++;
|
30
|
+
return await this.APIV2(...requestData);
|
31
|
+
} else {
|
32
|
+
return await this.APIV1(...requestData);
|
33
|
+
}
|
34
|
+
} catch (error) {
|
35
|
+
throw new Error('Balancer Error, contact fb.com/Lazic.Kanzu');
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
getStats() {
|
40
|
+
return {
|
41
|
+
totalRequests: this.totalRequests,
|
42
|
+
apiv2Requests: this.APIV2Requests,
|
43
|
+
apiv1Requests: this.totalRequests - this.APIV2Requests,
|
44
|
+
currentRatio: (this.APIV2Requests / this.totalRequests) * 100
|
45
|
+
};
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
module.exports = APILoadBalancer;
|
package/Language/index.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"UID": "Đăng Nhập Tại ID: %1",
|
9
9
|
"Area": "Vùng Của Tài Khoản Là: %1",
|
10
10
|
"NoAreaData": "Không Thể Lấy Vùng Của Tài Khoản !",
|
11
|
-
"NoAreaDataBypass": "Không Thể Lấy Vùng Của Tài Khoản
|
11
|
+
"NoAreaDataBypass": "Không Thể Lấy Vùng Của Tài Khoản Nhưng Đã Bỏ Qua Bước Đó 😔",
|
12
12
|
"OnLogin": "Đang Đăng Nhập ...",
|
13
13
|
"InvaildAccount": "Sai Mật Khẩu Hoặc Tài Khoản !",
|
14
14
|
"TwoAuth": "Bạn Đang Bật 2 Bảo Mật !",
|
@@ -62,26 +62,29 @@
|
|
62
62
|
"EnterSecurityCode": "Hãy Nhập Mã Xác Thực 2 Yếu Tố Của Bạn: ",
|
63
63
|
"ErrThroughCookies": "Đã Xảy Ra Lỗi Khi Xuyên 2Fa, Hãy Nhập Mã 2Fa Lại !",
|
64
64
|
|
65
|
-
"NodeVersionNotSupported": "Phiên Bản: %1 Không Được Hỗ Trợ, Tự Động Tải Phiên Bản
|
66
|
-
"UsingNVM": "Bạn
|
67
|
-
"DownloadingNode": "Đang
|
68
|
-
"NodeDownloadingComplete": "Tải Phiên Bản Node V14 Thành Công !",
|
65
|
+
"NodeVersionNotSupported": "Phiên Bản: %1 Không Được Hỗ Trợ, Tự Động Tải Phiên Bản Node.JS V14",
|
66
|
+
"UsingNVM": "Bạn Đang Sử Dụng NVM Để Control Node.JSVersion, Hãy Bấm 'nvm install 14.17.0' Sau Đó Bấm 'nvm use 14.17.0' Để Chuyển Sang Phiên Bản Được Hỗ Trợ !",
|
67
|
+
"DownloadingNode": "Đang Tải Phiên Bản Node.JS V14 Được Hỗ Trợ !",
|
68
|
+
"NodeDownloadingComplete": "Tải Phiên Bản Node.JS V14 Thành Công !",
|
69
69
|
"RestartRequire": "Tải Thành Công, Yêu Cầu Người Dùng Restart Máy Để Có Tác Dụng!",
|
70
|
-
"ErrNodeDownload": "Đã Xảy Ra Lỗi Trong Lúc Tự Động Tải Node Phiên Bản 14, Hãy Liên Hệ fb.com/kemsadboiz!",
|
70
|
+
"ErrNodeDownload": "Đã Xảy Ra Lỗi Trong Lúc Tự Động Tải Node.JS Phiên Bản 14, Hãy Liên Hệ fb.com/kemsadboiz!",
|
71
71
|
"RestartingN": "Đang Khởi Động Lại Chương Trình!",
|
72
72
|
"Rebuilding": "Đang Rebuild Lại Package NPM tránh lỗi !",
|
73
73
|
"ErrRebuilding": "Đã Xảy Ra Lỗi Tại Khu Vực Rebuilding - npm install",
|
74
74
|
"SuccessRebuilding": "Rebuilding Thành Công !",
|
75
75
|
"UnableToConnect": "Đã Sảy Ra Lỗi Trong Lúc Kết Nối Tới Máy Chủ Instant Action, Hãy Kiểm Tra Lại Wifi!",
|
76
|
-
"EVMChange": "Đang Thay Đổi Replit.nix Để Hỗ Trợ Node V14!",
|
76
|
+
"EVMChange": "Đang Thay Đổi Replit.nix Để Hỗ Trợ Node.JS V14!",
|
77
77
|
"EVMChangeSuccess": "Thay Đổi Replit.nix Thành Công, Tiến Hành Restarting!",
|
78
78
|
|
79
|
-
"Ws_TypeUserName": "Hãy Nhập Một UserName Cho Tài Khoản Websocket Extension
|
80
|
-
"Ws_TypePassWord": "Hãy Nhập Một Mật Khẩu Cho Tài Khoản WebSocket Extension
|
79
|
+
"Ws_TypeUserName": "Hãy Nhập Một UserName Cho Tài Khoản Websocket Extension Của Bạn: ",
|
80
|
+
"Ws_TypePassWord": "Hãy Nhập Một Mật Khẩu Cho Tài Khoản WebSocket Extension Của Bạn: ",
|
81
81
|
"Ws_Success": "Đặt Dữ Liệu Cho Websocket Extension Thành Công !",
|
82
|
-
"Ws_2Fa": "Đây
|
83
|
-
"Ws_2Fa_Check": "Hãy
|
84
|
-
|
82
|
+
"Ws_2Fa": "Đây Là Mã Xác Thực 2 Yếu Tố (2FA) Của Bạn Cho Horizon_Extension, Hãy Sử Dụng Google Authenticator Để Lấy Mã Phòng Trường Hợp Quên Mật Khẩu Hoặc Yêu Cầu Xác Minh !\n\n➣ Đây: %1",
|
83
|
+
"Ws_2Fa_Check": "Hãy Nhập Mã 2FA Của Bạn Từ Ứng Dụng Xác Thực: ",
|
84
|
+
|
85
|
+
"2FaBypassCheckpoint": "Tài Khoản Bạn Đang Cố Gắng Đăng Nhập Qua 2FA Đã Bị Dính 1 Dạng Checkpoint Nào Đấy, Hiện Tại Chưa Có Bản Fix Cho Checkpoint Ở 2FA, Hãy Liên Hệ Đến https://www.facebook.com/Lazic.Kanzu (Nguyễn Thái Hảo) Để Biết Chi Tiết Cách Sửa Lỗi !\n\n MÃ LỖI: %1",
|
86
|
+
"Bypass_956": "Đang Thử Nghiệm Coi Bạn Có Dính Checkpoint 956 Hay Không!",
|
87
|
+
"Bypass_AutoNoti": "Đã Vượt Qua Cảnh Báo Hành Vi Thành Công!",
|
85
88
|
|
86
89
|
"WishMessage": [
|
87
90
|
"Chúc Bạn Một Ngày Tốt Lành Nhé !!!",
|
@@ -123,7 +126,7 @@
|
|
123
126
|
"UID": "Login as ID: %1",
|
124
127
|
"Area": "Area Of Account Is: %1",
|
125
128
|
"NoAreaData": "Can't Get Area Of Account !",
|
126
|
-
"NoAreaDataBypass": "Can't Get
|
129
|
+
"NoAreaDataBypass": "Can't Get Account Area, But FCA Ignores It 😔",
|
127
130
|
"OnLogin": "Currently logged ...",
|
128
131
|
"InvaildAccount": "Wrong Password Or Account !",
|
129
132
|
"TwoAuth": "You Currently On 2 Factor Security !",
|
@@ -168,33 +171,36 @@
|
|
168
171
|
"AutoLogin": "AutoLogin Is On, Proceed to Log Back in!",
|
169
172
|
"TypeAccount": "Enter Account: ",
|
170
173
|
"TypePassword": "Enter a Password: ",
|
171
|
-
"TypeAccountError": "The
|
174
|
+
"TypeAccountError": "The Account Needs To Be an ID or Phone Number or Gmail!",
|
172
175
|
"ErrDataBase": "Error When Setting Auto Login Data !",
|
173
176
|
"SuccessSetData": "Auto Login Data Set Successfully !",
|
174
|
-
"Missing": "Please Code
|
177
|
+
"Missing": "Please Code 2FA According to the Photo's Guide in FastConfigFca.json Series AuthString!",
|
175
178
|
"EnterSecurityCode": "Enter your 2-Factor Authentication Code: ",
|
176
|
-
"ErrThroughCookies": "
|
179
|
+
"ErrThroughCookies": "2FA Piercing Error Occurred, Enter Code 2FA Again! ",
|
177
180
|
|
178
|
-
"NodeVersionNotSupported": "Version: %1
|
179
|
-
"UsingNVM": "You
|
180
|
-
"DownloadingNode": "Downloading
|
181
|
-
"NodeDownloadingComplete": "Successfully
|
182
|
-
"RestartRequire": "Download
|
183
|
-
"ErrNodeDownload": "An error occurred while automatically downloading
|
181
|
+
"NodeVersionNotSupported": "Version: %1 Is Not Supported, Automatically Download Node.JS Version V14",
|
182
|
+
"UsingNVM": "You Are Using NVM To Control Node.JS Version, Please Type 'nvm install 14.17.0' Then Type 'nvm use 14.17.0' To Switch To The Supported Version!",
|
183
|
+
"DownloadingNode": "Downloading Node.JS Version V14 Which Is Supported!",
|
184
|
+
"NodeDownloadingComplete": "Successfully Downloaded Node.JS Version V14!",
|
185
|
+
"RestartRequire": "Download Successful, User Needs To Restart The Computer To Take Effect!",
|
186
|
+
"ErrNodeDownload": "An error occurred while automatically downloading Node.JS version 14, please contact fb.com/kemsadboiz!",
|
184
187
|
"RestartingN": "Restarting the program!",
|
185
188
|
"Rebuilding": "Rebuilding npm package to avoid errors !",
|
186
189
|
"ErrRebuilding": "An error occurred in the rebuilding area - npm install",
|
187
190
|
"SuccessRebuilding": "Successfully rebuilt !",
|
188
191
|
"UnableToConnect": "An error occurred while connecting to the instant action server, please check your wifi connection!",
|
189
|
-
"EVMChange": "Changing replit.nix
|
190
|
-
"EVMChangeSuccess": "Successfully
|
192
|
+
"EVMChange": "Changing replit.nix To Support Node.JS V14!",
|
193
|
+
"EVMChangeSuccess": "Successfully Changed replit.nix, Go Ahead and Restart!",
|
194
|
+
|
195
|
+
"Ws_TypeUserName": "Please enter a username for your Websocket Extension account: ",
|
196
|
+
"Ws_TypePassWord": "Please enter a password for your Websocket Extension account: ",
|
197
|
+
"Ws_Success": "Successfully Set Data For Websocket Extension!",
|
198
|
+
"Ws_2Fa": "This is your two-factor authentication (2FA) code for Horizon_Extension. Please use Google Authenticator to retrieve the backup code in case you forget your password or require verification.\n\n ➣ Here: %1",
|
199
|
+
"Ws_2Fa_Check": "Please enter your 2FA code from The Authentication App: ",
|
191
200
|
|
192
|
-
"
|
193
|
-
"
|
194
|
-
"
|
195
|
-
"Ws_2Fa": "This is your two-factor authentication (2FA) code for horizon_extension. Please use Google Authenticator to retrieve the backup code in case you forget your password or require verification.\n\n ➣ Here: %1",
|
196
|
-
"Ws_2Fa_Check": "Please enter your 2FA code from the authentication app: ",
|
197
|
-
"Bypass_956": "Testing to see if you get checkpoint 956 or not!",
|
201
|
+
"2FaBypassCheckpoint": "The Account You Are Trying To Login To With 2FA Has Encountered a Checkpoint Error. There Is Currently No Fix For 2FA Checkpoints. Please Contact https://www.facebook.com/Lazic.Kanzu (Nguyễn Thái Hảo) For Detailed Troubleshooting Instructions.\n\n ERROR CODE: %1",
|
202
|
+
"Bypass_956": "Testing To See If You Get Checkpoint 956 or Not!",
|
203
|
+
"Bypass_AutoNoti": "Successfully Passed The Behavior Warning!",
|
198
204
|
|
199
205
|
"WishMessage": [
|
200
206
|
"Have a Nice Day !",
|
package/Main.js
CHANGED
@@ -280,6 +280,86 @@ function setOptions(globalOptions, options) {
|
|
280
280
|
});
|
281
281
|
}
|
282
282
|
|
283
|
+
function BypassAutomationNotification(response, jar, globalOptions, appstate,ID) {
|
284
|
+
global.Fca.BypassAutomationNotification = BypassAutomationNotification
|
285
|
+
try {
|
286
|
+
let UID;
|
287
|
+
if (ID) UID = ID
|
288
|
+
else {
|
289
|
+
UID = (appstate.find(i => i.key == 'c_user') || appstate.find(i => i.key == 'i_user'))
|
290
|
+
UID = UID.value;
|
291
|
+
}
|
292
|
+
if (response !== undefined) {
|
293
|
+
if (response.request.uri && response.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
294
|
+
if (response.request.uri.href.includes('601051028565049')) {
|
295
|
+
const fb_dtsg = utils.getFrom(response.body, '["DTSGInitData",[],{"token":"', '","');
|
296
|
+
const jazoest = utils.getFrom(response.body, 'jazoest=', '",');
|
297
|
+
const lsd = utils.getFrom(response.body, "[\"LSD\",[],{\"token\":\"", "\"}");
|
298
|
+
const FormBypass = {
|
299
|
+
av: UID,
|
300
|
+
fb_dtsg, jazoest, lsd,
|
301
|
+
fb_api_caller_class: "RelayModern",
|
302
|
+
fb_api_req_friendly_name: "FBScrapingWarningMutation",
|
303
|
+
variables: JSON.stringify({}),
|
304
|
+
server_timestamps: true,
|
305
|
+
doc_id: 6339492849481770
|
306
|
+
}
|
307
|
+
return utils.post("https://www.facebook.com/api/graphql/", jar, FormBypass, globalOptions)
|
308
|
+
.then(utils.saveCookies(jar)).then(function(res) {
|
309
|
+
global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.Bypass_AutoNoti);
|
310
|
+
return process.exit(1);
|
311
|
+
});
|
312
|
+
}
|
313
|
+
else {
|
314
|
+
return response;
|
315
|
+
}
|
316
|
+
}
|
317
|
+
else {
|
318
|
+
return response;
|
319
|
+
}
|
320
|
+
}
|
321
|
+
else {
|
322
|
+
return utils.get('https://www.facebook.com/', jar, null, globalOptions).then(function(res) {
|
323
|
+
if (res.request.uri && res.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
324
|
+
if (res.request.uri.href.includes('601051028565049')) return { Status: true, Body: res.body }
|
325
|
+
else return { Status: false, Body: res.body }
|
326
|
+
}
|
327
|
+
else return { Status: false, Body: res.body }
|
328
|
+
}).then(function(res) {
|
329
|
+
if (res.Status === true) {
|
330
|
+
const fb_dtsg = utils.getFrom(res.Body, '["DTSGInitData",[],{"token":"', '","');
|
331
|
+
const jazoest = utils.getFrom(res.Body, 'jazoest=', '",');
|
332
|
+
const lsd = utils.getFrom(res.Body, "[\"LSD\",[],{\"token\":\"", "\"}");
|
333
|
+
const FormBypass = {
|
334
|
+
av: UID,
|
335
|
+
fb_dtsg, jazoest, lsd,
|
336
|
+
fb_api_caller_class: "RelayModern",
|
337
|
+
fb_api_req_friendly_name: "FBScrapingWarningMutation",
|
338
|
+
variables: JSON.stringify({}),
|
339
|
+
server_timestamps: true,
|
340
|
+
doc_id: 6339492849481770
|
341
|
+
}
|
342
|
+
return utils.post("https://www.facebook.com/api/graphql/", jar, FormBypass, globalOptions).then(utils.saveCookies(jar))
|
343
|
+
.then(res => {
|
344
|
+
global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.Bypass_AutoNoti);
|
345
|
+
return res;
|
346
|
+
})
|
347
|
+
}
|
348
|
+
else return res;
|
349
|
+
})
|
350
|
+
.then(function() {
|
351
|
+
return utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true }).then(utils.saveCookies(jar))
|
352
|
+
})
|
353
|
+
.then(function() {
|
354
|
+
return process.exit(1);
|
355
|
+
})
|
356
|
+
}
|
357
|
+
}
|
358
|
+
catch (e) {
|
359
|
+
console.log(e);
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
283
363
|
/!-[ Function BuildAPI ]-!/
|
284
364
|
|
285
365
|
/**
|
@@ -289,6 +369,8 @@ function setOptions(globalOptions, options) {
|
|
289
369
|
*/
|
290
370
|
|
291
371
|
function buildAPI(globalOptions, html, jar, bypass_region) {
|
372
|
+
const fb_dtsg = utils.getFrom(html, '["DTSGInitData",[],{"token":"', '","')[0];
|
373
|
+
|
292
374
|
// var maybeCookie = jar.getCookies("https://www.facebook.com").filter(function(/** @type {{ cookieString: () => string; }} */val) { return val.cookieString().split("=")[0] === "c_user"; });
|
293
375
|
//check tiktik
|
294
376
|
var userID;
|
@@ -300,7 +382,7 @@ function buildAPI(globalOptions, html, jar, bypass_region) {
|
|
300
382
|
if (maybeUser.length === 0 && maybeTiktik.length === 0) {
|
301
383
|
if (global.Fca.Require.FastConfig.AutoLogin) {
|
302
384
|
return global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
|
303
|
-
global.Fca.Action('AutoLogin')
|
385
|
+
global.Fca.Action('AutoLogin');
|
304
386
|
});
|
305
387
|
}
|
306
388
|
else if (!global.Fca.Require.FastConfig.AutoLogin) {
|
@@ -334,9 +416,23 @@ else userID = maybeUser[0].cookieString().split("=")[1].toString();
|
|
334
416
|
var CHECK_MQTT = {
|
335
417
|
oldFBMQTTMatch: html.match(/irisSeqID:"(.+?)",appID:219994525426954,endpoint:"(.+?)"/),
|
336
418
|
newFBMQTTMatch: html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/),
|
337
|
-
legacyFBMQTTMatch: html.match(
|
419
|
+
legacyFBMQTTMatch: html.match(/\["MqttWebConfig",\[\],{"fbid":"(.*?)","appID":219994525426954,"endpoint":"(.*?)","pollingEndpoint":"(.*?)"/)
|
338
420
|
}
|
339
421
|
|
422
|
+
// List of region
|
423
|
+
/**
|
424
|
+
* PRN = Pacific Northwest Region (Khu vực Tây Bắc Thái Bình Dương)
|
425
|
+
* VLL = Valley Region
|
426
|
+
* ASH = Ashburn Region
|
427
|
+
* DFW = Dallas/Fort Worth Region
|
428
|
+
* LLA = Los Angeles Region
|
429
|
+
* FRA = Frankfurt
|
430
|
+
* SIN = Singapore
|
431
|
+
* NRT = Tokyo (Japan)
|
432
|
+
* HKG = Hong Kong
|
433
|
+
* SYD = Sydney
|
434
|
+
*/
|
435
|
+
|
340
436
|
let Slot = Object.keys(CHECK_MQTT);
|
341
437
|
|
342
438
|
var mqttEndpoint, region, irisSeqID;
|
@@ -363,7 +459,75 @@ else userID = maybeUser[0].cookieString().split("=")[1].toString();
|
|
363
459
|
}
|
364
460
|
return;
|
365
461
|
}
|
366
|
-
});
|
462
|
+
});
|
463
|
+
|
464
|
+
const regions = [
|
465
|
+
{
|
466
|
+
code: "PRN",
|
467
|
+
name: "Pacific Northwest Region",
|
468
|
+
location: "Khu vực Tây Bắc Thái Bình Dương"
|
469
|
+
},
|
470
|
+
{
|
471
|
+
code: "VLL",
|
472
|
+
name: "Valley Region",
|
473
|
+
location: "Valley"
|
474
|
+
},
|
475
|
+
{
|
476
|
+
code: "ASH",
|
477
|
+
name: "Ashburn Region",
|
478
|
+
location: "Ashburn"
|
479
|
+
},
|
480
|
+
{
|
481
|
+
code: "DFW",
|
482
|
+
name: "Dallas/Fort Worth Region",
|
483
|
+
location: "Dallas/Fort Worth"
|
484
|
+
},
|
485
|
+
{
|
486
|
+
code: "LLA",
|
487
|
+
name: "Los Angeles Region",
|
488
|
+
location: "Los Angeles"
|
489
|
+
},
|
490
|
+
{
|
491
|
+
code: "FRA",
|
492
|
+
name: "Frankfurt",
|
493
|
+
location: "Frankfurt"
|
494
|
+
},
|
495
|
+
{
|
496
|
+
code: "SIN",
|
497
|
+
name: "Singapore",
|
498
|
+
location: "Singapore"
|
499
|
+
},
|
500
|
+
{
|
501
|
+
code: "NRT",
|
502
|
+
name: "Tokyo",
|
503
|
+
location: "Japan"
|
504
|
+
},
|
505
|
+
{
|
506
|
+
code: "HKG",
|
507
|
+
name: "Hong Kong",
|
508
|
+
location: "Hong Kong"
|
509
|
+
},
|
510
|
+
{
|
511
|
+
code: "SYD",
|
512
|
+
name: "Sydney",
|
513
|
+
location: "Sydney"
|
514
|
+
},
|
515
|
+
{
|
516
|
+
code: "PNB",
|
517
|
+
name: "Pacific Northwest - Beta",
|
518
|
+
location: "Pacific Northwest "
|
519
|
+
}
|
520
|
+
];
|
521
|
+
|
522
|
+
if (!region) {
|
523
|
+
region = ['prn', "pnb", "vll", "hkg", "sin"][Math.random() * 5 | 0];
|
524
|
+
}
|
525
|
+
if (!mqttEndpoint) {
|
526
|
+
mqttEndpoint = "wss://edge-chat.facebook.com/chat?region=" + region;
|
527
|
+
}
|
528
|
+
|
529
|
+
const Location = regions.find(r => r.code === region.toUpperCase());
|
530
|
+
logger.Normal(getText(Language.Area, (Location == undefined ? region.toUpperCase() : Location.name)));
|
367
531
|
|
368
532
|
var ctx = {
|
369
533
|
userID: userID,
|
@@ -380,7 +544,8 @@ else userID = maybeUser[0].cookieString().split("=")[1].toString();
|
|
380
544
|
region: region,
|
381
545
|
firstListen: true,
|
382
546
|
req_ID: 0,
|
383
|
-
callback_Task: {}
|
547
|
+
callback_Task: {},
|
548
|
+
fb_dtsg
|
384
549
|
};
|
385
550
|
|
386
551
|
var api = {
|
@@ -989,7 +1154,7 @@ try {
|
|
989
1154
|
|
990
1155
|
else {
|
991
1156
|
mainPromise = utils
|
992
|
-
.get("https://www.facebook.com/", null, null, globalOptions, { noRef: true })
|
1157
|
+
.get("https://www.facebook.com/kemsadboiz", null, null, globalOptions, { noRef: true }) // for fixing
|
993
1158
|
.then(utils.saveCookies(jar))
|
994
1159
|
.then(makeLogin(jar, email, password, globalOptions, callback, prCallback))
|
995
1160
|
.then(function() {
|
@@ -1000,50 +1165,54 @@ try {
|
|
1000
1165
|
console.log(e);
|
1001
1166
|
}
|
1002
1167
|
|
1003
|
-
function CheckAndFixErr(res) {
|
1004
|
-
|
1005
|
-
|
1006
|
-
|
1007
|
-
|
1008
|
-
|
1009
|
-
|
1010
|
-
|
1011
|
-
|
1012
|
-
|
1013
|
-
|
1014
|
-
|
1015
|
-
|
1168
|
+
function CheckAndFixErr(res, fastSwitch) {
|
1169
|
+
if (fastSwitch) return res;
|
1170
|
+
let reg_antierr = /7431627028261359627/gs; // =))))))
|
1171
|
+
if (reg_antierr.test(res.body)) {
|
1172
|
+
const Data = JSON.stringify(res.body);
|
1173
|
+
const Dt_Check = Data.split('2Fhome.php&gfid=')[1];
|
1174
|
+
if (Dt_Check == undefined) return res;
|
1175
|
+
const fid = Dt_Check.split("\\\\")[0]; //fix sau
|
1176
|
+
if (Dt_Check == undefined || Dt_Check == "") return res;
|
1177
|
+
const final_fid = fid.split(`\\`)[0];
|
1178
|
+
if (final_fid == undefined || final_fid == '') return res;
|
1179
|
+
const redirectlink = redirect[1] + "a/preferences.php?basic_site_devices=m_basic&uri=" + encodeURIComponent("https://m.facebook.com/home.php") + "&gfid=" + final_fid;
|
1180
|
+
bypass_region_err = true;
|
1181
|
+
return utils.get(redirectlink, jar, null, globalOptions).then(utils.saveCookies(jar));
|
1182
|
+
}
|
1183
|
+
else return res;
|
1016
1184
|
}
|
1017
|
-
else return res
|
1018
|
-
};
|
1019
1185
|
|
1020
|
-
function Redirect(res) {
|
1021
|
-
|
1022
|
-
|
1023
|
-
|
1024
|
-
|
1025
|
-
|
1026
|
-
|
1027
|
-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1031
|
-
|
1032
|
-
|
1033
|
-
|
1034
|
-
|
1035
|
-
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
|
1186
|
+
function Redirect(res, fastSwitch) {
|
1187
|
+
if (fastSwitch) return res;
|
1188
|
+
var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
|
1189
|
+
redirect = reg.exec(res.body);
|
1190
|
+
if (redirect && redirect[1]) return utils.get(redirect[1], jar, null, globalOptions)
|
1191
|
+
return res;
|
1192
|
+
}
|
1193
|
+
|
1194
|
+
let redirect = [1, "https://m.facebook.com/"];
|
1195
|
+
let bypass_region_err = false;
|
1196
|
+
var ctx, api;
|
1197
|
+
mainPromise = mainPromise
|
1198
|
+
.then(res => Redirect(res))
|
1199
|
+
.then(res => CheckAndFixErr(res))
|
1200
|
+
//fix via login with defaut UA return WWW.facebook.com not m.facebook.com
|
1201
|
+
.then(function(res) {
|
1202
|
+
if (global.OnAutoLoginProcess) return res;
|
1203
|
+
else {
|
1204
|
+
let Regex_Via = /MPageLoadClientMetrics/gs; //default for normal account, can easily get region, without this u can't get region in some case but u can run normal
|
1205
|
+
if (!Regex_Via.test(res.body)) {
|
1206
|
+
//www.facebook.com
|
1207
|
+
globalOptions.userAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36 Edg/130.0.2849.68";
|
1208
|
+
return utils.get('https://www.facebook.com/', jar, null, globalOptions, { noRef: true })
|
1209
|
+
}
|
1210
|
+
else return res;
|
1211
|
+
}
|
1212
|
+
})
|
1213
|
+
.then(res => BypassAutomationNotification(res, jar, globalOptions, appState))
|
1214
|
+
.then(res => Redirect(res, global.OnAutoLoginProcess))
|
1215
|
+
.then(res => CheckAndFixErr(res, global.OnAutoLoginProcess))
|
1047
1216
|
|
1048
1217
|
// .then(function(res) {
|
1049
1218
|
// var reg = /<meta http-equiv="refresh" content="0;url=([^"]+)[^>]+>/;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "meta-horizonn",
|
3
|
-
"version": "1.3.
|
3
|
+
"version": "1.3.6",
|
4
4
|
"description": "Facebook-Chat-API Protect and Deploy by Kanzu and HZI Team. Kem is redeveloped. Rename package is Meta Horizonn and package supported ChatBot Messenger.",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -20,37 +20,33 @@
|
|
20
20
|
"aes-js": "latest",
|
21
21
|
"ansi-to-html": "latest",
|
22
22
|
"assert": "latest",
|
23
|
-
"axios": "^1.5.0",
|
24
23
|
"better-sqlite3": "7.6.2",
|
25
24
|
"bluebird": "latest",
|
26
25
|
"chalk": "4.1.2",
|
27
|
-
"cheerio": "
|
26
|
+
"cheerio": "1.0.0-rc.12",
|
28
27
|
"crypto-js": "latest",
|
29
28
|
"deasync": "^0.1.28",
|
30
29
|
"duplexify": "^4.1.2",
|
31
30
|
"encode32": "latest",
|
32
31
|
"express": "latest",
|
33
|
-
"figlet": "
|
32
|
+
"figlet": "latest",
|
34
33
|
"file-url": "^3.0.0",
|
35
|
-
"form-data": "^4.0.0",
|
36
|
-
"fs-extra": "^11.1.1",
|
37
34
|
"got": "^11.8.6",
|
38
35
|
"https-proxy-agent": "latest",
|
39
36
|
"is-hexcolor": "^1.0.0",
|
40
37
|
"lodash": "latest",
|
41
38
|
"moment": "^2.29.4",
|
42
|
-
"mqtt": "
|
39
|
+
"mqtt": "^4.3.7",
|
43
40
|
"npmlog": "latest",
|
44
41
|
"os": "latest",
|
45
42
|
"path": "latest",
|
46
43
|
"pretty-ms": "7.0.1",
|
47
|
-
"puppeteer": "^21.1.1",
|
48
44
|
"readable-stream": "^4.4.0",
|
49
45
|
"readline": "latest",
|
50
46
|
"request": "latest",
|
51
47
|
"speakeasy": "latest",
|
52
48
|
"sqlite3": "^5.0.2",
|
53
|
-
"totp-generator": "
|
49
|
+
"totp-generator": "^0.0.14",
|
54
50
|
"tough-cookie": "^4.1.2",
|
55
51
|
"uuid": "latest",
|
56
52
|
"ws": "^8.13.0"
|
@@ -61,7 +57,7 @@
|
|
61
57
|
"devDependencies": {
|
62
58
|
"eslint": "^8.40.0",
|
63
59
|
"mocha": "latest",
|
64
|
-
"prettier": "
|
60
|
+
"prettier": "^3.3.3"
|
65
61
|
},
|
66
62
|
"eslintConfig": {
|
67
63
|
"env": {
|
package/src/listenMqtt.js
CHANGED
@@ -322,7 +322,7 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
|
|
322
322
|
var presence = {
|
323
323
|
type: "presence",
|
324
324
|
userID: userID.toString(),
|
325
|
-
//
|
325
|
+
//Convert to ms
|
326
326
|
timestamp: data["l"] * 1000,
|
327
327
|
statuses: data["p"]
|
328
328
|
};
|
@@ -341,6 +341,7 @@ function listenMqtt(defaultFuncs, api, ctx, globalCallback) {
|
|
341
341
|
LogUptime();
|
342
342
|
process.kill(process.pid);
|
343
343
|
});
|
344
|
+
|
344
345
|
process.on('exit', LogUptime);
|
345
346
|
}
|
346
347
|
|
@@ -799,7 +800,7 @@ function parseDelta(defaultFuncs, api, ctx, globalCallback, {
|
|
799
800
|
break;
|
800
801
|
}
|
801
802
|
case 'NewMessage': {
|
802
|
-
const hasLiveLocation = (delta) => {
|
803
|
+
const hasLiveLocation = (delta) => {
|
803
804
|
const attachment = delta.attachments?.[0]?.mercury?.extensible_attachment;
|
804
805
|
const storyAttachment = attachment?.story_attachment;
|
805
806
|
return storyAttachment?.style_list?.includes('message_live_location');
|
@@ -840,13 +841,23 @@ function markDelivery(ctx, api, threadID, messageID) {
|
|
840
841
|
|
841
842
|
module.exports = function(defaultFuncs, api, ctx) {
|
842
843
|
var globalCallback = identity;
|
844
|
+
var okeoke;
|
843
845
|
getSeqID = function getSeqID() {
|
844
846
|
ctx.t_mqttCalled = false;
|
845
847
|
defaultFuncs
|
846
848
|
.post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form)
|
849
|
+
.then(res => {
|
850
|
+
okeoke = res;
|
851
|
+
return res;
|
852
|
+
})
|
847
853
|
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
848
854
|
.then((resData) => {
|
849
855
|
if (utils.getType(resData) != "Array") {
|
856
|
+
if (resData.request.uri && resData.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
857
|
+
if (resData.request.uri.href.includes('601051028565049')) {
|
858
|
+
return global.Fca.BypassAutomationNotification(undefined, ctx.jar, ctx.globalOptions, undefined ,process.env.UID)
|
859
|
+
}
|
860
|
+
}
|
850
861
|
if (global.Fca.Require.FastConfig.AutoLogin) {
|
851
862
|
return global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
|
852
863
|
return global.Fca.Action('AutoLogin');
|
@@ -872,6 +883,11 @@ module.exports = function(defaultFuncs, api, ctx) {
|
|
872
883
|
})
|
873
884
|
.catch((err) => {
|
874
885
|
log.error("getSeqId", err);
|
886
|
+
if (okeoke.request.uri && okeoke.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
887
|
+
if (okeoke.request.uri.href.includes('601051028565049')) {
|
888
|
+
return global.Fca.BypassAutomationNotification(undefined, ctx.jar, ctx.globalOptions, undefined ,process.env.UID)
|
889
|
+
}
|
890
|
+
}
|
875
891
|
if (utils.getType(err) == "Object" && err.error === global.Fca.Require.Language.Index.ErrAppState) ctx.loggedIn = false;
|
876
892
|
return globalCallback(err);
|
877
893
|
});
|
package/src/unsendMessage.js
CHANGED
@@ -1,17 +1,20 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
+
const Balancer = require('../Extra/Balancer.js');
|
3
4
|
var utils = require("../utils");
|
4
5
|
var log = require("npmlog");
|
5
6
|
|
6
7
|
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
-
|
8
|
+
//const BalancerInstance = new Balancer(api.unsendMessage, unsendMessage, 0.85);
|
9
|
+
|
10
|
+
function unsendMessage(messageID, threadID, callback) {
|
8
11
|
var resolveFunc = function () {};
|
9
12
|
var rejectFunc = function () {};
|
10
13
|
var returnPromise = new Promise(function (resolve, reject) {
|
11
14
|
resolveFunc = resolve;
|
12
15
|
rejectFunc = reject;
|
13
16
|
});
|
14
|
-
|
17
|
+
|
15
18
|
if (!callback) {
|
16
19
|
callback = function (err, friendList) {
|
17
20
|
if (err) return rejectFunc(err);
|
@@ -19,21 +22,27 @@ module.exports = function (defaultFuncs, api, ctx) {
|
|
19
22
|
};
|
20
23
|
}
|
21
24
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
+
if (threadID) return api.unsendMqttMessage(threadID, messageID, callback);
|
26
|
+
else {
|
27
|
+
var form = {
|
28
|
+
message_id: messageID
|
29
|
+
};
|
30
|
+
|
31
|
+
defaultFuncs
|
32
|
+
.post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, form)
|
33
|
+
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
34
|
+
.then(function (resData) {
|
35
|
+
if (resData.error) throw resData;
|
36
|
+
return callback();
|
37
|
+
})
|
38
|
+
.catch(function (err) {
|
39
|
+
log.error("unsendMessage", err);
|
40
|
+
return callback(err);
|
41
|
+
});
|
42
|
+
|
43
|
+
return returnPromise;
|
44
|
+
}
|
45
|
+
}
|
25
46
|
|
26
|
-
|
27
|
-
|
28
|
-
.then(utils.parseAndCheckLogin(ctx, defaultFuncs))
|
29
|
-
.then(function (resData) {
|
30
|
-
if (resData.error) throw resData;
|
31
|
-
return callback();
|
32
|
-
})
|
33
|
-
.catch(function (err) {
|
34
|
-
log.error("unsendMessage", err);
|
35
|
-
return callback(err);
|
36
|
-
});
|
37
|
-
return returnPromise;
|
38
|
-
};
|
39
|
-
};
|
47
|
+
return unsendMessage;
|
48
|
+
};
|
@@ -0,0 +1,66 @@
|
|
1
|
+
/* eslint-disable linebreak-style */
|
2
|
+
"use strict";
|
3
|
+
|
4
|
+
var utils = require("../utils");
|
5
|
+
|
6
|
+
module.exports = function (defaultFuncs, api, ctx) {
|
7
|
+
return function(threadID, messageID ,callback) {
|
8
|
+
var resolveFunc = function () {};
|
9
|
+
var rejectFunc = function () {};
|
10
|
+
|
11
|
+
var returnPromise = new Promise(function (resolve, reject) {
|
12
|
+
resolveFunc = resolve;
|
13
|
+
rejectFunc = reject;
|
14
|
+
});
|
15
|
+
|
16
|
+
if (!callback && utils.getType(messageID) === "AsyncFunction" || !callback && utils.getType(messageID) === "Function") messageID = callback;
|
17
|
+
|
18
|
+
if (!callback) {
|
19
|
+
callback = function (err, data) {
|
20
|
+
if (err) return rejectFunc(err);
|
21
|
+
resolveFunc(data);
|
22
|
+
};
|
23
|
+
}
|
24
|
+
|
25
|
+
const Payload = {
|
26
|
+
message_id: messageID,
|
27
|
+
thread_key: threadID,
|
28
|
+
sync_group: 1
|
29
|
+
};
|
30
|
+
|
31
|
+
if (messageID != undefined || messageID != null) Payload.reply_metadata = {
|
32
|
+
reply_source_id: messageID,
|
33
|
+
reply_source_type: 1,
|
34
|
+
reply_type: 0
|
35
|
+
};
|
36
|
+
|
37
|
+
const Form = JSON.stringify({
|
38
|
+
app_id: "2220391788200892",
|
39
|
+
payload: JSON.stringify({
|
40
|
+
tasks: [{
|
41
|
+
label: 33,
|
42
|
+
payload: JSON.stringify(Payload),
|
43
|
+
queue_name: "unsend_message",
|
44
|
+
task_id: Math.random() * 1001 << 0,
|
45
|
+
failure_count: null,
|
46
|
+
}],
|
47
|
+
epoch_id: utils.generateOfflineThreadingID(),
|
48
|
+
version_id: '9094446350588544',
|
49
|
+
|
50
|
+
}),
|
51
|
+
request_id: ++ctx.req_ID,
|
52
|
+
type: 3
|
53
|
+
});
|
54
|
+
|
55
|
+
ctx.mqttClient.publish('/ls_req', Form,{
|
56
|
+
qos: 1,
|
57
|
+
retain: false,
|
58
|
+
});
|
59
|
+
ctx.callback_Task[ctx.req_ID] = new Object({
|
60
|
+
callback,
|
61
|
+
type: "unsendMqttMessage",
|
62
|
+
});
|
63
|
+
|
64
|
+
return returnPromise;
|
65
|
+
};
|
66
|
+
};
|
package/utils.js
CHANGED
@@ -2677,7 +2677,12 @@ function parseAndCheckLogin(ctx, defaultFuncs, retryCount) {
|
|
2677
2677
|
const Check = () => new Promise((re) => {
|
2678
2678
|
defaultFuncs.get('https://facebook.com', ctx.jar).then(function(res) {
|
2679
2679
|
if (res.headers.location && res.headers.location.includes('https://www.facebook.com/checkpoint/')) {
|
2680
|
-
if (res.headers.includes('828281030927956')) return global.Fca.Action('Bypass', ctx, "956", defaultFuncs)
|
2680
|
+
if (res.headers.location.includes('828281030927956')) return global.Fca.Action('Bypass', ctx, "956", defaultFuncs)
|
2681
|
+
else if (res.request.uri && res.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
2682
|
+
if (res.request.uri.href.includes('601051028565049')) {
|
2683
|
+
return global.Fca.BypassAutomationNotification(undefined, ctx.jar, ctx.globalOptions, undefined ,process.env.UID)
|
2684
|
+
}
|
2685
|
+
}
|
2681
2686
|
else return global.Fca.Require.logger.Error(global.Fca.Require.Language.Index.ErrAppState);
|
2682
2687
|
}
|
2683
2688
|
else return global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
|
@@ -2688,6 +2693,11 @@ function parseAndCheckLogin(ctx, defaultFuncs, retryCount) {
|
|
2688
2693
|
await Check();
|
2689
2694
|
});
|
2690
2695
|
}
|
2696
|
+
if (res.request.uri && res.request.uri.href.includes("https://www.facebook.com/checkpoint/")) {
|
2697
|
+
if (res.request.uri.href.includes('601051028565049')) {
|
2698
|
+
return global.Fca.BypassAutomationNotification(undefined, ctx.jar, ctx.globalOptions, undefined ,process.env.UID)
|
2699
|
+
}
|
2700
|
+
}
|
2691
2701
|
if (global.Fca.Require.FastConfig.AutoLogin) {
|
2692
2702
|
return global.Fca.Require.logger.Warning(global.Fca.Require.Language.Index.AutoLogin, function() {
|
2693
2703
|
return global.Fca.Action('AutoLogin');
|
@@ -3006,21 +3016,21 @@ function cleanHTML (text) {
|
|
3006
3016
|
|
3007
3017
|
module.exports = {
|
3008
3018
|
cleanHTML,
|
3009
|
-
isReadableStream:isReadableStream,
|
3010
|
-
get:get,
|
3011
|
-
post:post,
|
3012
|
-
postFormData:postFormData,
|
3013
|
-
generateThreadingID:generateThreadingID,
|
3014
|
-
generateOfflineThreadingID:generateOfflineThreadingID,
|
3015
|
-
getGUID:getGUID,
|
3016
|
-
getFrom:getFrom,
|
3017
|
-
makeParsable:makeParsable,
|
3018
|
-
arrToForm:arrToForm,
|
3019
|
-
getSignatureID:getSignatureID,
|
3019
|
+
isReadableStream: isReadableStream,
|
3020
|
+
get: get,
|
3021
|
+
post: post,
|
3022
|
+
postFormData: postFormData,
|
3023
|
+
generateThreadingID: generateThreadingID,
|
3024
|
+
generateOfflineThreadingID: generateOfflineThreadingID,
|
3025
|
+
getGUID: getGUID,
|
3026
|
+
getFrom: getFrom,
|
3027
|
+
makeParsable: makeParsable,
|
3028
|
+
arrToForm: arrToForm,
|
3029
|
+
getSignatureID: getSignatureID,
|
3020
3030
|
getJar: request.jar,
|
3021
|
-
generateTimestampRelative:generateTimestampRelative,
|
3022
|
-
makeDefaults:makeDefaults,
|
3023
|
-
parseAndCheckLogin:parseAndCheckLogin,
|
3031
|
+
generateTimestampRelative: generateTimestampRelative,
|
3032
|
+
makeDefaults: makeDefaults,
|
3033
|
+
parseAndCheckLogin: parseAndCheckLogin,
|
3024
3034
|
getGender: getGenderByPhysicalMethod,
|
3025
3035
|
getData_Path,
|
3026
3036
|
setData_Path,
|