From e48251e75e8a2d37bedfd517d5cdcd0c0162bfc3 Mon Sep 17 00:00:00 2001 From: sczerniawski <39490863+sczerniawski@users.noreply.github.com> Date: Mon, 18 Sep 2023 08:15:35 +0200 Subject: [PATCH 1/4] Fix crash related to --latest-stamps (#2056) --- instaloader/lateststamps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instaloader/lateststamps.py b/instaloader/lateststamps.py index 5846948..02959ba 100644 --- a/instaloader/lateststamps.py +++ b/instaloader/lateststamps.py @@ -27,7 +27,8 @@ class LatestStamps: self.data.read(latest_stamps_file) def _save(self): - makedirs(dirname(self.file), exist_ok=True) + if dn := dirname(self.file): + makedirs(dn, exist_ok=True) with open(self.file, 'w') as f: self.data.write(f) From 8bc35cf3a148b97e0c8f8cd238b6ddc1a4b7d995 Mon Sep 17 00:00:00 2001 From: LostXOR <45744247+LostXOR@users.noreply.github.com> Date: Sun, 15 Oct 2023 23:23:25 -0700 Subject: [PATCH 2/4] Fixed error when trying to log in due to changes by Instagram (#2088) --- instaloader/instaloadercontext.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/instaloader/instaloadercontext.py b/instaloader/instaloadercontext.py index 7659af3..ffb326d 100644 --- a/instaloader/instaloadercontext.py +++ b/instaloader/instaloadercontext.py @@ -405,20 +405,13 @@ class InstaloaderContext: raise ConnectionException("HTTP error code {}.".format(resp.status_code)) is_html_query = not is_graphql_query and not "__a" in params and host == "www.instagram.com" if is_html_query: - match = re.search(r'window\._sharedData = (.*);', resp.text) + # Extract JSON from HTML response + match = re.search('(?<={"raw":").*?(?', - resp.text) - if match is not None: - post_or_profile_page[0]['graphql'] = json.loads(match.group(1))['graphql'] + raise QueryReturnedNotFoundException("Could not find JSON data in html response.") + # Unescape escaped JSON string + unescaped_string = match.group(0).encode("utf-8").decode("unicode_escape") + resp_json = json.loads(unescaped_string) return resp_json else: resp_json = resp.json() From 6145c5b3836493d232daec0becd8f2eceb75d105 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:26:10 +0200 Subject: [PATCH 3/4] Temporarily disable lint check on python 3.11 It fails due to a problem with installing dependencies, which is already fixed in a3dc75c04e873f560761f450df9344d139037a23. --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 665213a..cc3fd8e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -9,7 +9,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10"] steps: - name: Checkout Instaloader Repository uses: actions/checkout@v2 From 51a16a433eabc89accd67982617e20d6787de8ab Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Mon, 16 Oct 2023 08:27:46 +0200 Subject: [PATCH 4/4] Release of version 4.10.1 --- instaloader/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instaloader/__init__.py b/instaloader/__init__.py index cad0beb..d9457a3 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.10' +__version__ = '4.10.1' try: