Last active
August 25, 2024 18:09
-
-
Save Suleman-Elahi/3b6c1e02ead4c849ceb7e70955b55180 to your computer and use it in GitHub Desktop.
Sript to unsave all saved Instagram posts. Uses Instagram private API by ping and its extensions to do the heavy lifting.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from instagram_private_api import Client, ClientCompatPatch | |
from instagram_private_api_extensions import pagination | |
import json, time | |
user_name = 'UserName' | |
password = 'PassWord' | |
api = Client(user_name, password) | |
items=[] | |
for results in pagination.page(api.saved_feed, args={}): | |
if results.get('items'): | |
items.extend(results['items']) | |
print("Starting unsaving posts.....") | |
for i,x in enumerate(items): | |
z = items[i]['media']['pk'] | |
api.unsave_photo(media_id=z) | |
time.sleep(3) | |
print("Unsaved: ", z) |
@Suleman-Elahi Ok, I have already disabled 2FA yesterday. So how could I solve this? IG keeps notify me to change my password each time ...
You will have to wait for a few days...or you can use VPN with server in the same country as you. Or, if you can get your ISP to give you a new IP address then perhaps it can be solved.
@GetIt7788 open terminal in the folder where the unsaver.py file. And then run it like this python unsaver.py
if it errors then tell me. It should work though.
403 forbidden likely cased for abusing the API. Try after using a VPN and make sure that account doesn't have 2FA enabled.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@Suleman-Elahi Ok, I have already disabled 2FA yesterday. So how could I solve this? IG keeps notify me to change my password each time ...