@@ -1101,7 +1101,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/2/search/adaptive.json"
|
endpoint = "/2/search/adaptive.json"
|
||||||
params = self.params.copy()
|
params = self.params.copy()
|
||||||
params["q"] = query
|
params["q"] = query
|
||||||
# params["tweet_search_mode"] = "live"
|
params["tweet_search_mode"] = "live"
|
||||||
params["query_source"] = "typed_query"
|
params["query_source"] = "typed_query"
|
||||||
params["pc"] = "1"
|
params["pc"] = "1"
|
||||||
params["spelling_corrections"] = "1"
|
params["spelling_corrections"] = "1"
|
||||||
@@ -1241,6 +1241,7 @@ class TwitterAPI():
|
|||||||
|
|
||||||
def _pagination_legacy(self, endpoint, params):
|
def _pagination_legacy(self, endpoint, params):
|
||||||
original_retweets = (self.extractor.retweets == "original")
|
original_retweets = (self.extractor.retweets == "original")
|
||||||
|
bottom = ("cursor-bottom-", "sq-cursor-bottom")
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
data = self._call(endpoint, params)
|
data = self._call(endpoint, params)
|
||||||
@@ -1261,7 +1262,7 @@ class TwitterAPI():
|
|||||||
entries = instr["addEntries"]["entries"]
|
entries = instr["addEntries"]["entries"]
|
||||||
elif "replaceEntry" in instr:
|
elif "replaceEntry" in instr:
|
||||||
entry = instr["replaceEntry"]["entry"]
|
entry = instr["replaceEntry"]["entry"]
|
||||||
if entry["entryId"].startswith("cursor-bottom-"):
|
if entry["entryId"].startswith(bottom):
|
||||||
cursor = (entry["content"]["operation"]
|
cursor = (entry["content"]["operation"]
|
||||||
["cursor"]["value"])
|
["cursor"]["value"])
|
||||||
|
|
||||||
@@ -1278,7 +1279,7 @@ class TwitterAPI():
|
|||||||
entry["content"]["timelineModule"]["metadata"]
|
entry["content"]["timelineModule"]["metadata"]
|
||||||
["conversationMetadata"]["allTweetIds"][::-1])
|
["conversationMetadata"]["allTweetIds"][::-1])
|
||||||
|
|
||||||
elif entry_startswith(("cursor-bottom-", "sq-cursor-bottom")):
|
elif entry_startswith(bottom):
|
||||||
cursor = entry["content"]["operation"]["cursor"]
|
cursor = entry["content"]["operation"]["cursor"]
|
||||||
if not cursor.get("stopOnEmptyResponse", True):
|
if not cursor.get("stopOnEmptyResponse", True):
|
||||||
# keep going even if there are no tweets
|
# keep going even if there are no tweets
|
||||||
|
|||||||
Reference in New Issue
Block a user