From cb977c1f19b553354f731e7068255530dbf3f7de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20B=C3=B8hm?= <46354423+anbohm@users.noreply.github.com> Date: Sun, 24 Mar 2019 17:27:44 +0100 Subject: [PATCH] Corrected image name. The filename of image was long and wrong. Choose another metode to set filename. --- instagram_slideshow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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