-
-
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.
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(1) | |
print("Unsaved: ", z) |
Author
hmble
commented
May 19, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment