dilame / instagram-private-api

NodeJS Instagram private API SDK. Written in TypeScript.
MIT License
6k stars 1.14k forks source link

How to mute user stories/posts? #1455

Closed kaandura closed 3 years ago

kaandura commented 3 years ago

Thanks for the great library guys, I have a one general question though. How can I mute someone's posts and stories using Instagram API?

Nerixyz commented 3 years ago

Take a look at ig.friendship.mutePostsOrStoryFromFollow.

CryogenicPlanet commented 3 years ago

Hey would love some clarity on what the props here are

https://github.com/dilame/instagram-private-api/blob/a509790136cb8b57354488ae57c84c48f71362ef/src/repositories/friendship.repository.ts#L95-L97

And how would I go about doing something like this (from the examples) where I mute these users. Basically, if I have an AccountFollowingFeedResponseUsersItem I want to mute how would I mute them

https://github.com/dilame/instagram-private-api/blob/a509790136cb8b57354488ae57c84c48f71362ef/examples/unfollow-users.example.ts#L27

BKDaugherty commented 2 years ago

@CryogenicPlanet, not sure if you're still working on this, or you figured it out yourself, but for any other sorry souls hitting this thread, I found it to work when I used the following:

const user_id = user_id_like_to_mute.pk;

await ig.friendship.mutePostsOrStoryFromFollow({
  mediaId: null,
  targetReelAuthorId: user_id,
  targetPostsAuthorId: user_id,
});
rafaeltgt commented 2 years ago

@CryogenicPlanet, not sure if you're still working on this, or you figured it out yourself, but for any other sorry souls hitting this thread, I found it to work when I used the following:

const user_id = user_id_like_to_mute.pk;

await ig.friendship.mutePostsOrStoryFromFollow({
  mediaId: null,
  targetReelAuthorId: user_id,
  targetPostsAuthorId: user_id,
});

When I run this code, it seems that only Posts is muted, not Stories. I'm looking at the User page on android app after tapping on Following button.

It seems it might be needed a parameter similar to "targetStoriesAuthorId"

ig_mute

BKDaugherty commented 2 years ago

That’s weird. It worked for both stories and posts for me. You can see my code here (beware it is absolute garbage but it got the job done 🙃): https://github.com/BKDaugherty/ig-mute