From ed3fce45da0e1b2b07a1e99ec02275dffca6bf79 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:22:08 +0100 Subject: [PATCH 1/5] More emphasis on documentation in --help output --- instaloader/__main__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instaloader/__main__.py b/instaloader/__main__.py index 1d5e984..accea66 100644 --- a/instaloader/__main__.py +++ b/instaloader/__main__.py @@ -222,14 +222,13 @@ def _main(instaloader: Instaloader, targetlist: List[str], # Instaloader did at least save a session file instaloader.context.log("No targets were specified, thus nothing has been downloaded.") else: - # Instloader did not do anything + # Instaloader did not do anything instaloader.context.log("usage:" + usage_string()) def main(): parser = ArgumentParser(description=__doc__, add_help=False, usage=usage_string(), - epilog="Report issues at https://github.com/instaloader/instaloader/issues. " - "The complete documentation can be found at " + epilog="The complete documentation can be found at " "https://instaloader.github.io/.", fromfile_prefix_chars='+') From 3530cdc55ccbbae5e6d8097275eae3a95d6b6ff5 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:26:27 +0100 Subject: [PATCH 2/5] Fix rare FileNotFoundError in resumable_iterator() ... that occured when using a path name for the FrozenNodeIterator file whose dirname was ''. --- instaloader/nodeiterator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instaloader/nodeiterator.py b/instaloader/nodeiterator.py index c72fe46..7fbe154 100644 --- a/instaloader/nodeiterator.py +++ b/instaloader/nodeiterator.py @@ -263,7 +263,8 @@ def resumable_iteration(context: InstaloaderContext, try: yield is_resuming, start_index except KeyboardInterrupt: - os.makedirs(os.path.dirname(resume_file_path), exist_ok=True) + if os.path.dirname(resume_file_path): + os.makedirs(os.path.dirname(resume_file_path), exist_ok=True) save(iterator.freeze(), resume_file_path) context.log("\nSaved resume information to {}.".format(resume_file_path)) raise From ace0e944ec369017b5f407672ad33db2f98442bc Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Wed, 2 Dec 2020 19:33:13 +0100 Subject: [PATCH 3/5] docs: Fix description of Story.last_seen_utc --- instaloader/structures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/instaloader/structures.py b/instaloader/structures.py index 3dd31ef..98415c9 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -1086,14 +1086,14 @@ class Story: @property def last_seen_local(self) -> Optional[datetime]: - """Timestamp when the story has last been watched or None (local time zone).""" + """Timestamp of the most recent StoryItem that has been watched or None (local time zone).""" if self._node['seen']: return datetime.fromtimestamp(self._node['seen']) return None @property def last_seen_utc(self) -> Optional[datetime]: - """Timestamp when the story has last been watched or None (UTC).""" + """Timestamp of the most recent StoryItem that has been watched or None (UTC).""" if self._node['seen']: return datetime.utcfromtimestamp(self._node['seen']) return None From 0be11291739e0f62c34a024b249fab109ac7a81b Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 4 Dec 2020 13:12:24 +0100 Subject: [PATCH 4/5] Fix login redirect triggering 429 handling Closes #902. --- instaloader/instaloadercontext.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/instaloader/instaloadercontext.py b/instaloader/instaloadercontext.py index a138092..51e83f3 100644 --- a/instaloader/instaloadercontext.py +++ b/instaloader/instaloadercontext.py @@ -324,8 +324,10 @@ class InstaloaderContext: redirect_url = resp.headers['location'] self.log('\nHTTP redirect from https://{0}/{1} to {2}'.format(host, path, redirect_url)) if redirect_url.startswith('https://www.instagram.com/accounts/login'): + if not self.is_logged_in: + raise LoginRequiredException("Redirected to login page. Use --login.") # alternate rate limit exceeded behavior - raise TooManyRequestsException("429 Too Many Requests: redirected to login") + raise TooManyRequestsException("Redirected to login") if redirect_url.startswith('https://{}/'.format(host)): resp = sess.get(redirect_url if redirect_url.endswith('/') else redirect_url + '/', params=params, allow_redirects=False) From 3dcb0ff542bffd915ada5a682fb7cf42ed3d359d Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Fri, 4 Dec 2020 13:28:53 +0100 Subject: [PATCH 5/5] Release of Version 4.5.5 --- instaloader/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instaloader/__init__.py b/instaloader/__init__.py index 6d4e90a..155722f 100644 --- a/instaloader/__init__.py +++ b/instaloader/__init__.py @@ -1,7 +1,7 @@ """Download pictures (or videos) along with their captions and other metadata from Instagram.""" -__version__ = '4.5.4' +__version__ = '4.5.5' try: