Skip to content

Commit

Permalink
[twitter] generalize "Login Required" error (#4734, #4324)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 5, 2023
1 parent da0da0f commit cf5702c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions gallery_dl/extractor/twitter.py
Expand Up @@ -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:
Expand Down

0 comments on commit cf5702c

Please sign in to comment.