[twitter] add 'search-stop' option (#8173)

and rename 'pagination-search' to 'search-pagination'
This commit is contained in:
Mike Fährmann
2025-09-08 17:16:16 +02:00
parent fdfcaa00b9
commit f6fcba4040
3 changed files with 37 additions and 20 deletions

View File

@@ -1460,16 +1460,20 @@ class TwitterAPI():
"withGrokTranslatedBio": False,
}
if self.extractor.config("pagination-search") in (
"id", "tweet_id", "max_id"):
if self.extractor.config("search-pagination") in (
"max_id", "maxid", "id"):
update_variables = self._update_variables_search
else:
update_variables = None
stop_tweets = self.extractor.config("search-stop")
if stop_tweets is None or stop_tweets == "auto":
stop_tweets = 3 if update_variables is None else 0
return self._pagination_tweets(
endpoint, variables,
("search_by_raw_query", "search_timeline", "timeline"),
stop_tweets=3, update_variables=update_variables)
stop_tweets=stop_tweets, update_variables=update_variables)
def community_query(self, community_id):
endpoint = "/graphql/2W09l7nD7ZbxGQHXvfB22w/CommunityQuery"