Skip to content

Instantly share code, notes, and snippets.

@hmble
Forked from Suleman-Elahi/unsaver.py
Created December 16, 2021 09:10
Show Gist options
  • Save hmble/18b787d814f72be9c93e556cb917cf34 to your computer and use it in GitHub Desktop.
Save hmble/18b787d814f72be9c93e556cb917cf34 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.
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(1)
print("Unsaved: ", z)
@hmble
Copy link
Author

hmble commented May 19, 2022

- pip install git+https://[email protected]/ping/[email protected]
- pip install git+https://[email protected]/ping/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment