junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.58k stars 135 forks source link

ERR: Not able to publish new thread using the API v1.3.1 #115

Closed sudarshanmg closed 12 months ago

sudarshanmg commented 12 months ago

Problem:

yekayee commented 12 months ago

same problem

Aerglonus commented 12 months ago

Try to get the token with and pass it manually

const token = await threadsAPI.getToken()
  const threadsAPI = new ThreadsAPI({
    token: `${token}`,
    username: '${username}', // Your username
    password: `${password}`, // Your password
  });
sudarshanmg commented 12 months ago

In your code, You cannot access threadsAPI before initialization right? You are creating a new object named threadsAPI after you are trying to access it to get token.

yekayee commented 12 months ago

any example?

LilaRest commented 12 months ago

Same here, it seems that the problem comes from authentication. After examining the output of const { data } = await axios<string>(LOGIN_URL, requestConfig); in getToken() method I found error messages:

yekayee commented 12 months ago

Aerglonus

can u give me example? sorry im newbie

Aerglonus commented 12 months ago

In your code, You cannot access threadsAPI before initialization right? You are creating a new object named threadsAPI after you are trying to access it to get token.

can u give me example? sorry im newbie

const main = async () => {
  const threadsAPI = new ThreadsAPI({
    username: 'username', // Your username
    password: 'password', // Your password
  });
  const token = await threadsAPI.getToken()
  console.log(token)
}

This is how I got the token and I was able to post again but apparently the getToken its failing #113 (with the token I got I'm still able to post )

yekayee commented 12 months ago

Username and password are required

yekayee commented 12 months ago

image

francistogram commented 12 months ago

I think we’re all having the same issue and my guess is that Threads changed how their auth flow worked so this code broke because it expected the auth token response in a certain format

https://github.com/junhoyeo/threads-api/issues/113

junhoyeo commented 12 months ago

Hey all, I released v1.4.0 with encrypted passwords. Please try out! 🚀