[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)
|
self.extractor.wait(until=until, seconds=seconds)
|
||||||
continue
|
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
|
# error
|
||||||
try:
|
try:
|
||||||
data = response.json()
|
data = response.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user