incandenza-11 / blockout2024

Automated script for BlockOut2024
16 stars 6 forks source link

Enhancement: Retrieve and Compare Blocked User List from Instagram Using Instagrapi #7

Closed loosiegoosey closed 5 months ago

loosiegoosey commented 5 months ago

As the username block list grows in length, it might be more efficient to get a list of blocked users from Instagram to compare currently blocked usernames with the Instagram username list. I looked at the instagrapi documentation a bit and didn't see anything like get_blocked_users, so I'm not entirely sure if what I'm proposing is possible.

incandenza-11 commented 5 months ago

Thanks for the suggestion @loosiegoosey, I think it makes a lot of sense. I'll work on this asap 👌

molinto commented 5 months ago

Perhaps a visit to the users page: https://www.instagram.com/accounts/blocked_accounts/

loosiegoosey commented 5 months ago

@molinto good idea. perhaps parse the HTML and extract the blocked usernames using a library like beautifulsoup4 to scrape the webpage?

incandenza-11 commented 5 months ago

It's a good idea, I believe we'll have to deal with some kind of pagination though. Having +300 blocked accounts already takes some time to load the full list.

Ideally I'd do this via instagrapi but I don't see any way of getting this info (as @loosiegoosey mentioned)

incandenza-11 commented 5 months ago

After researching this, it seems that scrapping Instagram would not be the best solution, as Instagram tracks all scrapping activity and may lead to banning. Instead, I'd go for a more custom solution by manually keeping track of all blocked users in the repository cache dir after the first execution.

incandenza-11 commented 5 months ago

Closing this issue after applying the last suggestion. Keeping it this way until instagrapi allows to retrieve the list of an account's blocked users.