From 6bfdc75c858cca735bbe6d34dde58bb917ba4551 Mon Sep 17 00:00:00 2001 From: Darknessest <32790500+darknessest@users.noreply.github.com> Date: Sun, 9 Jan 2022 12:31:35 +0800 Subject: [PATCH] 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. --- tweepy/pagination.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.25.1