[twitter] better error message for guest searches (#3942)
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user