From 28f5a45825bc8ec979528950992d6944603121bd Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Fri, 13 Jan 2023 06:59:51 +0000 Subject: [PATCH] Fix empty page counter not getting reset on results --- snscrape/modules/twitter.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/snscrape/modules/twitter.py b/snscrape/modules/twitter.py index 1d99068..ca27478 100644 --- a/snscrape/modules/twitter.py +++ b/snscrape/modules/twitter.py @@ -808,6 +808,8 @@ class _TwitterAPIScraper(snscrape.base.Scraper): if self._maxEmptyPages and emptyPages >= self._maxEmptyPages: _logger.warning(f'Stopping after {emptyPages} empty pages') break + else: + emptyPages = 0 if not newCursor or (stopOnEmptyResponse and tweetCount == 0): # End of pagination if promptCursor is not None: