From d07bd6a096fc5ea33fef69df5cba0211e7d9cd12 Mon Sep 17 00:00:00 2001 From: Eduardo M KALINOWSKI Date: Fri, 3 Feb 2023 20:17:32 -0300 Subject: [PATCH] Detect redirects to https://i.instagram.com/accounts/login --- instaloader/instaloadercontext.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instaloader/instaloadercontext.py b/instaloader/instaloadercontext.py index b575710..b19f1ba 100644 --- a/instaloader/instaloadercontext.py +++ b/instaloader/instaloadercontext.py @@ -331,7 +331,8 @@ class InstaloaderContext: while resp.is_redirect: 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 (redirect_url.startswith('https://www.instagram.com/accounts/login') or + redirect_url.startswith('https://i.instagram.com/accounts/login')): if not self.is_logged_in: raise LoginRequiredException("Redirected to login page. Use --login.") # alternate rate limit exceeded behavior