misonomikadev / messenger-api.js

A powerful Node.js module that allow you to interact with the Facebook API.
MIT License
37 stars 7 forks source link

parseAndCheckLogin got status code: 404. Bailing out of trying to parse response. #6

Closed tachittanachote closed 1 year ago

tachittanachote commented 1 year ago

Some facebook account cannot log in correctly.

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: parseAndCheckLogin got status code: 404. Bailing out of trying to parse response.
    at C:\Users\Tachittanachote\Desktop\Facebook\node_modules\messenger-api.js\src\lib\utils.js:994:48
    at tryCatcher (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\util.js:26:23)
    at Promise.attempt.Promise.try (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\method.js:31:24)
    at C:\Users\Tachittanachote\Desktop\Facebook\node_modules\messenger-api.js\src\lib\utils.js:972:28
    at tryCatcher (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\util.js:26:23)
    at Promise._settlePromiseFromHandler (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\promise.js:510:31)
    at Promise._settlePromiseAt (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\promise.js:584:18)
    at Async._drainQueue (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\async.js:128:12)
    at Async._drainQueues (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\async.js:133:10)
    at Async.drainQueues [as _onImmediate] (C:\Users\Tachittanachote\Desktop\Facebook\node_modules\bluebird\js\main\async.js:15:14)
    at process.processImmediate (node:internal/timers:471:21)

Node.js v18.12.1

Debugging result at parseAndCheckLogin function

data.statusCode: 200
data.request.uri: Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'www.facebook.com',
  port: 443,
  hostname: 'www.facebook.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/chat/user_info/',
  path: '/chat/user_info/',
  href: 'https://www.facebook.com/chat/user_info/'
}

data.statusCode: 500
data.request.uri: Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'www.facebook.com',
  port: 443,
  hostname: 'www.facebook.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/api/graphqlbatch/',
  path: '/api/graphqlbatch/',
  href: 'https://www.facebook.com/api/graphqlbatch/'
}

data.statusCode: 404
data.request.uri: Url {
  protocol: 'https:',
  slashes: true,
  auth: null,
  host: 'www.facebook.com',
  port: 443,
  hostname: 'www.facebook.com',
  hash: null,
  search: null,
  query: null,
  pathname: '/api/graphqlbatch/',
  path: '/api/graphqlbatch/',
  href: 'https://www.facebook.com/api/graphqlbatch/'
}
misonomikadev commented 1 year ago

hmmmmmmmmmmm, let me see :>

tachittanachote commented 1 year ago

It seems const threads = await api.getThreadList(100, null, []) on Client.js at line 43 it is working incorrectly. I have tried to reduce getThreadList limit 100 to 1 it works.

misonomikadev commented 1 year ago

hmm, if you do that, you won't have enough threads to bot used, maybe i have to add another option to change thread bot can fetch :>