alicezetion 1.3.1 → 1.3.2
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.
@@ -1 +1 @@
|
|
1
|
-
{"nonce":
|
1
|
+
{"nonce":8738110445171051501,"last_updated":{"seconds":1693540068,"nanos":102197000}}
|
package/index.js
CHANGED
@@ -94,6 +94,8 @@ function buildAPI(globalOptions, html, jar) {
|
|
94
94
|
if (html.indexOf("/checkpoint/block/?next") > -1) log.warn("login", "Checkpoint detected. Please log in with a browser to verify.");
|
95
95
|
|
96
96
|
var userID = maybeCookie[0].cookieString().split("=")[1].toString();
|
97
|
+
//log.info("login", `Logged in as ${userID}`);
|
98
|
+
|
97
99
|
try {
|
98
100
|
clearInterval(checkVerified);
|
99
101
|
} catch (_) {}
|
@@ -110,18 +112,21 @@ function buildAPI(globalOptions, html, jar) {
|
|
110
112
|
irisSeqID = oldFBMQTTMatch[1];
|
111
113
|
mqttEndpoint = oldFBMQTTMatch[2];
|
112
114
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
115
|
+
//log.info("login", `Got this account's message region: ${region}`);
|
113
116
|
} else {
|
114
117
|
let newFBMQTTMatch = html.match(/{"app_id":"219994525426954","endpoint":"(.+?)","iris_seq_id":"(.+?)"}/);
|
115
118
|
if (newFBMQTTMatch) {
|
116
119
|
irisSeqID = newFBMQTTMatch[2];
|
117
120
|
mqttEndpoint = newFBMQTTMatch[1].replace(/\\\//g, "/");
|
118
121
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
122
|
+
log.info("login", `Got this account's message region: ${region}`);
|
119
123
|
} else {
|
120
124
|
let legacyFBMQTTMatch = html.match(/(\["MqttWebConfig",\[\],{fbid:")(.+?)(",appID:219994525426954,endpoint:")(.+?)(",pollingEndpoint:")(.+?)(3790])/);
|
121
125
|
if (legacyFBMQTTMatch) {
|
122
126
|
mqttEndpoint = legacyFBMQTTMatch[4];
|
123
127
|
region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
|
124
128
|
log.warn("login", `Cannot get sequence ID with new RegExp. Fallback to old RegExp (without seqID)...`);
|
129
|
+
log.info("login", `Got this account's message region: ${region}`);
|
125
130
|
log.info("login", `[Unused] Polling endpoint: ${legacyFBMQTTMatch[6]}`);
|
126
131
|
} else {
|
127
132
|
log.warn("login", "» Cannot get MQTT region & sequence ID.");
|
@@ -262,6 +267,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
|
|
262
267
|
});
|
263
268
|
// ---------- Very Hacky Part Ends -----------------
|
264
269
|
|
270
|
+
log.info("login", "Logging in...");
|
265
271
|
return utils
|
266
272
|
.post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, form, loginOptions)
|
267
273
|
.then(utils.saveCookies(jar))
|
@@ -482,6 +488,7 @@ function loginHelper(appState, email, password, globalOptions, callback, prCallb
|
|
482
488
|
// At the end we call the callback or catch an exception
|
483
489
|
mainPromise
|
484
490
|
.then(function() {
|
491
|
+
//log.info("login", 'Done logging in.');
|
485
492
|
return callback(null, api);
|
486
493
|
})
|
487
494
|
.catch(function(e) {
|
@@ -508,7 +515,7 @@ function login(loginData, options, callback) {
|
|
508
515
|
logRecordSize: defaultLogRecordSize,
|
509
516
|
online: false,
|
510
517
|
emitReady: false,
|
511
|
-
userAgent: "Mozilla/5.0 (
|
518
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18"
|
512
519
|
};
|
513
520
|
|
514
521
|
setOptions(globalOptions, options);
|