0

I'm doing a project where I use the instaloader API for python and I want to download images from the feed and stories of a profile, but I want the loop code to only download the images if they are new...

In the documentation it says about the LatestStamps(latest_stamps_file) class, but I can't use it...

Can someone help me?

import instaloader

ig = instaloader.Instaloader(save_metadata=False, download_video_thumbnails=False)

user = "USER"
password = "PASSWORD"

profile_name = input ("Enter Instagram Profile Name: ")

print ("Downloading Media...")

ig.login(user, password)
ig.download_profile(profile_name, download_stories_only=True,profile_pic=False)

print ("Stories Download Completed!")
Komand
  • 1
  • 1

1 Answers1

0

There is a key word argument called fast_update docs said it's the same as using --fast-update flag:

For each target, stop when encountering the first already-downloaded picture. This flag is recommended when you use Instaloader to update your personal Instagram archive.

So, in your case, you need to replace this line

ig.download_profile(profile_name, download_stories_only=True,profile_pic=False)

To this:

ig.download_profile(profile_name, download_stories_only=True, profile_pic=False, fast_update=True)
Alex Kosh
  • 2,206
  • 2
  • 19
  • 18