From a6c279211de032ec57979fa6785c6688f60a0dc7 Mon Sep 17 00:00:00 2001 From: Alexander Graf <17130992+aandergr@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:26:16 +0000 Subject: [PATCH] Do not crash on a fatal status response without Content-Type --- instaloader/instaloadercontext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instaloader/instaloadercontext.py b/instaloader/instaloadercontext.py index 8fd6e89..53e5d05 100644 --- a/instaloader/instaloadercontext.py +++ b/instaloader/instaloadercontext.py @@ -418,7 +418,7 @@ class InstaloaderContext: return redirect = " redirect to {}".format(resp.headers['location']) if 'location' in resp.headers else "" body = "" - if resp.headers['Content-Type'].startswith('application/json'): + if resp.headers.get('Content-Type', '').startswith('application/json'): body = ': ' + resp.text[:500] + ('…' if len(resp.text) > 501 else '') raise AbortDownloadException("Query to https://{}/{} responded with \"{} {}\"{}{}".format( host, path, resp.status_code, resp.reason, redirect, body