[twitter] better error message for guest searches (#3942)

This commit is contained in:
Mike Fährmann
2023-06-01 16:03:45 +02:00
parent 271f23d971
commit 45cc7cee1a

View File

@@ -1418,6 +1418,12 @@ class TwitterAPI():
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")
# error
try:
data = response.json()