Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when following a user #1797

Open
3 of 6 tasks
JonJon565 opened this issue Sep 4, 2024 · 0 comments
Open
3 of 6 tasks

Error when following a user #1797

JonJon565 opened this issue Sep 4, 2024 · 0 comments
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin

Comments

@JonJon565
Copy link

Bug Report

Form

Requirements

Platform

  • I'm using Node.js version v16.16.0
  • I'm using electron - xd

Description

Getting an error when trying to follow a user,

ig.friendship.create doesn't seem to work

Code

//basically doing this would give the error
 ig.friendship.create(58215877889)
//or this

async function followLikers(mediaId) {
  const likersFeed = await ig.media.likers(mediaId);
  for (let i = 0; i < likersFeed.users.length && i < 10000; i++) {
    const liker = likersFeed.users[i];
    try {
      await ig.friendship.create(liker.pk);
      console.log(`Followed user: ${liker.username}`);
    } catch (err) {
      console.error(`Error following user ${liker.username}:`, err);
    }
    await new Promise(resolve => setTimeout(resolve, 1000));
  }

  console.log('Finished following likers.');
}

Error and Output

Error following user fabo.2029: IgNotFoundError: POST /api/v1/friendships/create/58215877889/ - 404 Not Found; 
    at Request.handleResponseError (c:\Users\e\Documents\NodeJS\Instagram API\node_modules\instagram-private-api\dist\core\request.js:103:20)
    at Request.send (c:\Users\e\Documents\NodeJS\Instagram API\node_modules\instagram-private-api\dist\core\request.js:54:28)
    at async FriendshipRepository.change (c:\Users\e\Documents\NodeJS\Instagram API\node_modules\instagram-private-api\dist\repositories\friendship.repository.js:59:26)
    at async followLikers (c:\Users\e\Documents\NodeJS\Instagram API\index.js:71:7)
    at async C:\Users\e\Documents\NodeJS\Instagram API\index.js:30:3 {stack: 'IgNotFoundError: POST /api/v1/friendships/cre…cuments\\NodeJS\\Instagram API\\index.js:30:3', message: 'POST /api/v1/friendships/create/58215877889/ - 404 Not Found; ', name: 'IgNotFoundError', response: IncomingMessage}
IgNotFoundError: POST /api/v1/friendships/create/58215877889/ - 404 Not Found; 
    at eval (eval-2cf44ba1.repl:1:7)
    at followLikers (C:\\Users\\e\\Documents\\NodeJS\\Instagram API\\index.js:74:7)
    at async C:\\Users\\e\\Documents\\NodeJS\\Instagram API\\index.js:30:3
@JonJon565 JonJon565 added bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin labels Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unconfirmed This issue hasn't been read/confirmed/accepted by an admin
Projects
None yet
Development

No branches or pull requests

1 participant