From cf5702c84333fc375a7f984dccb9deb1d29f1903 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 5 Dec 2023 15:13:58 +0100 Subject: [PATCH] [twitter] generalize "Login Required" error (#4734, #4324) --- gallery_dl/extractor/twitter.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index ca1e90674d..56877ede0c 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -1289,11 +1289,9 @@ def _call(self, endpoint, params, method="GET", auth=True, root=None): self.extractor.wait(until=until, seconds=seconds) continue - if response.status_code == 403 and \ - not self.headers["x-twitter-auth-type"] and \ - endpoint == "/2/search/adaptive.json": - raise exception.AuthorizationError( - "Login required to access search results") + if response.status_code in (403, 404) and \ + not self.headers["x-twitter-auth-type"]: + raise exception.AuthorizationError("Login required") # error try: