From: Darknessest <32790500+darknessest@users.noreply.github.com> Date: Sun, 9 Jan 2022 04:31:35 +0000 (+0800) Subject: fix pagination for tweet counts X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6bfdc75c858cca735bbe6d34dde58bb917ba4551;p=tweepy.git fix pagination for tweet counts `get_all_tweets_count` is using `next_token` for pagination. `next_token` is returned only when a difference between start and end time is more than 31 days, no matter the granularity. --- diff --git a/tweepy/pagination.py b/tweepy/pagination.py index 0e0b41c..1013394 100644 --- a/tweepy/pagination.py +++ b/tweepy/pagination.py @@ -88,7 +88,8 @@ class PaginationIterator: # https://twittercommunity.com/t/why-does-timeline-use-pagination-token-while-search-uses-next-token/150963 if self.method.__name__ in ("search_all_tweets", - "search_recent_tweets"): + "search_recent_tweets", + "get_all_tweets_count"): self.kwargs["next_token"] = pagination_token else: self.kwargs["pagination_token"] = pagination_token