2018-06-04 12:55:49 +03:00
|
|
|
import instaloader
|
|
|
|
|
|
|
|
L = instaloader.Instaloader()
|
|
|
|
|
2020-07-31 23:12:27 +03:00
|
|
|
USER = "your_account"
|
2018-06-04 12:55:49 +03:00
|
|
|
PROFILE = USER
|
|
|
|
|
2020-07-31 23:12:27 +03:00
|
|
|
# Load session previously saved with `instaloader -l USERNAME`:
|
2018-06-04 12:55:49 +03:00
|
|
|
L.load_session_from_file(USER)
|
|
|
|
|
|
|
|
profile = instaloader.Profile.from_username(L.context, PROFILE)
|
|
|
|
|
|
|
|
likes = set()
|
2020-07-31 23:12:27 +03:00
|
|
|
print("Fetching likes of all posts of profile {}.".format(profile.username))
|
2018-06-04 12:55:49 +03:00
|
|
|
for post in profile.get_posts():
|
|
|
|
print(post)
|
|
|
|
likes = likes | set(post.get_likes())
|
|
|
|
|
2020-07-31 23:12:27 +03:00
|
|
|
print("Fetching followers of profile {}.".format(profile.username))
|
2018-06-04 12:55:49 +03:00
|
|
|
followers = set(profile.get_followers())
|
|
|
|
|
|
|
|
ghosts = followers - likes
|
|
|
|
|
2020-07-31 23:12:27 +03:00
|
|
|
print("Storing ghosts into file.")
|
|
|
|
with open("inactive-users.txt", 'w') as f:
|
2018-06-04 12:55:49 +03:00
|
|
|
for ghost in ghosts:
|
|
|
|
print(ghost.username, file=f)
|