diff --git a/instagram_slideshow.py b/instagram_slideshow.py index 18a1006..e1944a4 100644 --- a/instagram_slideshow.py +++ b/instagram_slideshow.py @@ -168,7 +168,8 @@ def download_any_new_instagram_photos(self): try: for photo in json_data["data"]: image_url = photo["images"]["standard_resolution"]["url"] - photo_filename = image_url[image_url.rindex("/") + 1:] + image_link = photo["link"] + photo_filename = image_link.split('/')[4] + '.jpg' if not os.path.isfile(self.LOCAL_PHOTO_DIRECTORY_PATH + photo_filename): # save to disk any new photos that were not saved previously new_photos_downloaded = True