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

ECONNRESET Error When Trying to Post to Threads #101

Closed a-burlakovv closed 12 months ago

a-burlakovv commented 12 months ago

I've been trying to use the threads-api library to post to my Threads account programmatically. However, I'm encountering an ECONNRESET error and I'm unsure how to proceed.

Here's the script I'm using:

import { ThreadsAPI } from 'threads-api';

const main = async () => { const threadsAPI = new ThreadsAPI({ username: 'my_username', // My actual username is replaced here password: 'my_password', // My actual password is replaced here });

await threadsAPI.publish({ text: '🤖 Hello World', }); };

main();

When I run this script, I get the following error:

AxiosError: read ECONNRESET ...

The error suggests that the other side of the TCP conversation (in this case, the Instagram server) is unexpectedly closing the connection. I'm not sure why this is happening. My internet connection seems to be stable, and I've verified that my username and password are correct.

Could you provide any guidance on what might be causing this issue and how I could resolve it? Any help would be greatly appreciated.

a-burlakovv commented 12 months ago

I figured this one on my own – i am from Russia and Instagram is blocking any traffic from my country. So i used VPN instead and everything worked.

junhoyeo commented 12 months ago

@a-burlakovv Thanks for the follow-up! 🙏 Too bad to hear Instagram blocking Russia 😭