From 7de317d1b5bdf53b0ff0bb07f351669bebb175fb Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Fri, 23 Feb 2024 15:54:33 +0000 Subject: [PATCH] avoiding exception --- src/auto_archiver/archivers/instagram_api_archiver.py | 2 +- src/auto_archiver/version.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/auto_archiver/archivers/instagram_api_archiver.py b/src/auto_archiver/archivers/instagram_api_archiver.py index 0d3bc01..5afaab2 100644 --- a/src/auto_archiver/archivers/instagram_api_archiver.py +++ b/src/auto_archiver/archivers/instagram_api_archiver.py @@ -200,7 +200,7 @@ class InstagramAPIArchiver(Archiver): post_count = 0 while end_cursor != "": posts = self.call_api(f"v1/user/medias/chunk", {"user_id": user_id, "end_cursor": end_cursor}) - if not len(posts): break + if not len(posts) or not type(posts) == list or len(posts) != 2: break posts, end_cursor = posts[0], posts[1] logger.info(f"parsing {len(posts)} posts, next {end_cursor=}") diff --git a/src/auto_archiver/version.py b/src/auto_archiver/version.py index 0e146d8..cfca40c 100644 --- a/src/auto_archiver/version.py +++ b/src/auto_archiver/version.py @@ -3,7 +3,7 @@ _MAJOR = "0" _MINOR = "9" # On main and in a nightly release the patch should be one ahead of the last # released build. -_PATCH = "9" +_PATCH = "10" # This is mainly for nightly builds which have the suffix ".dev$DATE". See # https://semver.org/#is-v123-a-semantic-version for the semantics. _SUFFIX = ""