davidarroyo1234 / InstagramUnfollowers

Check if people follows you back on Instagram.
MIT License
2.95k stars 266 forks source link

Kindly need a snippet of code that function "GetFollowingStatus" or any equivalent #201

Open Llydo1 opened 1 day ago

Llydo1 commented 1 day ago

Sorry for interrupt with such an annoying issue like this

I have been working with your app for many times and I can say that it is one of the best for social media marketing, etc

Currently, I am working on my personal project which talk directly to my server to archive the follower/following status of a single account

I wonder which snippet of code in this project you are using to know whether a person is followed us so I can integrate it to my project. Because the current code is somewhat obscure to me

Sincere, Llydo1

davidarroyo1234 commented 23 hours ago

Sorry for interrupt with such an annoying issue like this

I have been working with your app for many times and I can say that it is one of the best for social media marketing, etc

Currently, I am working on my personal project which talk directly to my server to archive the follower/following status of a single account

I wonder which snippet of code in this project you are using to know whether a person is followed us so I can integrate it to my project. Because the current code is somewhat obscure to me

Sincere, Llydo1

Hi,

On main.tsx Line 239 you have the petition to the instagram api. However you will need to pass a lot of cookie and everything to be able to use it outside instragram.com.

If you want to do this exact petition though postman, you will need to copy all the cookie and storage data.

Probably if you do this step wrong you could get ban after some tryes. SO be careful.

Llydo1 commented 14 hours ago

Thank you for your help

I was able to get the API

Just for further discussion: I also notice that the maximum number of followers that can be shown in a response is first":"50", would it be better than first":"24"?

https://www.instagram.com/graphql/query/?query_hash=3dec7e2c57367ef3da3d987d89f9dbc8&variables={"id":"${ds_user_id}","include_reel":"true","fetch_mutual":"false","first":"50"}

davidarroyo1234 commented 8 hours ago

Thank you for your help

I was able to get the API

Just for further discussion: I also notice that the maximum number of followers that can be shown in a response is first":"50", would it be better than first":"24"?

https://www.instagram.com/graphql/query/?query_hash=3dec7e2c57367ef3da3d987d89f9dbc8&variables={"id":"${ds_user_id}","include_reel":"true","fetch_mutual":"false","first":"50"}

This url is taken from when you scroll in you followers list, so in the day were 24 and I tried to clone the behaviour of that scroll but through an api to dont be detected as a bot. Maybe you wont have problem with 50 but be careful.

Also i tried to day to see the url, and this one is not being use anymore, so maybe in a future this url stops working.

As experiment you could try the new api url etc IN F12->Network-> and filter XHR

image

Now there are 2 petition 1 for the user data and other one for the status of each ID

Llydo1 commented 1 hour ago

I also experimented the current "scroll down" request. It even gives the maximum number of 200 follower per response which astonish me. More than 200 will return status code 400. However, this api do not shown the "following", "follower" status like the one you are using, so basically, it is useless for our use case. If the old api goes deprecate, it might take more requests to achieve the same results (Get the list of pk_id -> request each individual pk_id to get their following list -> match the first pk_id of the response with our account pk_id).

Snippet of response of a following user using the current api https://www.instagram.com/api/v1/friendships/[ds_user_id]/following/?count=12&__s=[some_value]:

 {
            "pk": "",
            "pk_id": "",
            "id": "",
            "username": "",
            "full_name": "",
            "is_private": ,
            "fbid_v2": "",
            "third_party_downloads_enabled": ,
            "strong_id__": "",
            "profile_pic_id": "",
            "profile_pic_url": ",
            "is_verified": ,
            "has_anonymous_profile_picture": ,
            "account_badges": ,
            "latest_reel_media": ,
            "is_favorite": 
 }

Edit: Another approach has come to my mind is to compare the follower list vs the following list. If the follower list also gives the maximum of 200 user per response like the following, it will dramatically reduce the number of requests. I have not yet test the follower API yet. Will try on tomorrow

Another further discussion: the current following/follower API of Threads are showing mostly the same value as the Instagram API. Can this app be compatible with the new Threads API? If yes, I'd love to contribute (If I have time).

davidarroyo1234 commented 1 hour ago

I also experimented the current "scroll down" request. It even gives the maximum number of 200 follower per response which astonish me. More than 200 will return status code 400. However, this api do not shown the "following", "follower" status like the one you are using, so basically, it is useless for our use case. If the old api goes deprecate, it might take more requests to achieve the same results (Get the list of pk_id -> request each individual pk_id to get their following list -> match the first pk_id of the response with our account pk_id).

Snippet of response of a following user using the current api https://www.instagram.com/api/v1/friendships/[ds_user_id]/following/?count=12&__s=[some_value]:

 {
            "pk": "",
            "pk_id": "",
            "id": "",
            "username": "",
            "full_name": "",
            "is_private": ,
            "fbid_v2": "",
            "third_party_downloads_enabled": ,
            "strong_id__": "",
            "profile_pic_id": "",
            "profile_pic_url": ",
            "is_verified": ,
            "has_anonymous_profile_picture": ,
            "account_badges": ,
            "latest_reel_media": ,
            "is_favorite": 
 }

Another further discussion: the current following/follower API of Threads are showing mostly the same value as the Instagram API. Can this app be compatible with the new Threads API? If yes, I'd love to contribute (If I have time).

If you check here, instagram makes 2 request image

one with 12 accounts and the other one with another 12 "account" with the status following etc.

Maybe you could call 200 people and 200 on the other one. And the match the id.

But probably getting 200 will get ban? I dont really know.

About threads, im guessing that if its the same, we could just check if its instagram or threads and change a bit the url