alicezetion 1.2.4 → 1.2.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"nonce":243310921411882231,"last_updated":{"seconds":1693007378,"nanos":164182000}}
1
+ {"nonce":6928808597510966173,"last_updated":{"seconds":1693007708,"nanos":164183000}}
package/index.js CHANGED
@@ -121,6 +121,8 @@ function buildAPI(globalOptions, html, jar) {
121
121
  if (legacyFBMQTTMatch) {
122
122
  mqttEndpoint = legacyFBMQTTMatch[4];
123
123
  region = new URL(mqttEndpoint).searchParams.get("region").toUpperCase();
124
+ log.warn("login", `Cannot get sequence ID with new RegExp. Fallback to old RegExp (without seqID)...`);
125
+ log.info("login", `[Unused] Polling endpoint: ${legacyFBMQTTMatch[6]}`);
124
126
  } else {
125
127
  log.warn("login", "» Cannot get MQTT region & sequence ID.");
126
128
  log.error("login", "» Please try closing and reopening your browser window or get new fbstate.");
@@ -259,6 +261,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
259
261
  jar.setCookie(utils.formatCookie(cookieData, "facebook"), "https://www.facebook.com");
260
262
  });
261
263
  // ---------- Very Hacky Part Ends -----------------
264
+
262
265
  return utils
263
266
  .post("https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=110", jar, form, loginOptions)
264
267
  .then(utils.saveCookies(jar))
@@ -322,9 +325,10 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
322
325
  }
323
326
  })
324
327
  .then(function() {
328
+ // Use the same form (safe I hope)
325
329
  delete form.no_fido;
326
330
  delete form.approvals_code;
327
- form.name_action_selected = 'dont_save';
331
+ form.name_action_selected = 'dont_save'; //'save_device';
328
332
 
329
333
  return utils.post(nextURL, jar, form, loginOptions).then(utils.saveCookies(jar));
330
334
  })
@@ -359,6 +363,7 @@ function makeLogin(jar, email, password, loginOptions, callback, prCallback) {
359
363
  JSON.parse(res.body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""));
360
364
  } catch (ex) {
361
365
  clearInterval(checkVerified);
366
+ log.info("login", "Verified from browser. Logging in...");
362
367
  if (callback === prCallback) {
363
368
  callback = function(err, api) {
364
369
  if (err) return prReject(err);
@@ -498,7 +503,7 @@ function login(loginData, options, callback) {
498
503
  updatePresence: false,
499
504
  forceLogin: false,
500
505
  autoMarkDelivery: false,
501
- autoMarkRead: false,
506
+ autoMarkRead: true,
502
507
  autoReconnect: true,
503
508
  logRecordSize: defaultLogRecordSize,
504
509
  online: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alicezetion",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "test": "mocha",