Skip to content
This repository has been archived by the owner on Jul 9, 2022. It is now read-only.

Is this api dead? #862

Open
ghost opened this issue Jan 15, 2021 · 2 comments
Open

Is this api dead? #862

ghost opened this issue Jan 15, 2021 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 15, 2021

When trying to login I get this:

{
  error: 'Error retrieving userID. This can be caused by a lot of things, incling getting blocked by Facebook for logging in from an unknown location. Try lging in with a browser to verify.'
}

but I can normally login through browser 🤔
I have 2FA enabled.

@royalgarter
Copy link

Same problem, happen since yesterday. Its must be some updates from Facebook.

@royalgarter
Copy link

royalgarter commented Jan 18, 2021

F.Y.I

There are some notices about this issue

  1. If you are still logged-in via cookie (appstate) using this API, then you go to normal Chrome and switch to another account, the current cookie is immediately invalid (which throw the above error). If you don't switch account, look like it's not gonna break.
  2. You can get cookie manually very easy using this Chrome Extension with a little convert code like below example. Remember to concat cookies from 2 domain "facebook.com" and "messenger.com" to 1 single array JSON.
'use strict';
const cookie_chrome = require('./cookie_chrome.json'); //Manually export using http://www.editthiscookie.com/
let cookie = [];

for (let cch of cookie_chrome) {
	let c = Object.assign({}, cch);
        
       // convert to appState key/value
	c.key = c.name;
	c.domain = c.domain.replace(/^\./,'');

	cookie.push(c); 
}

require('fs').writeFileSync('APPSTATE.cookie', JSON.stringify(cookie));
  1. When I was totallly out, I take some debug step and notice that Facebook REALLY DID some change to the login steps with checkpoint (approval code) that break the API. One error that I captured is
/*Line 218 index.js: */ if (html.indexOf("checkpoint/?next") > -1) {

is now invalid check. The html body check should be "checkpoint?next" only.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant