From 8e747b6dee576742b1eb3004b6e692e28fe74867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 9 Jul 2024 20:40:40 +0200 Subject: [PATCH] [twitter] send initial 'cursor' only when given via option --- gallery_dl/extractor/twitter.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gallery_dl/extractor/twitter.py b/gallery_dl/extractor/twitter.py index 8e06da12..52899c11 100644 --- a/gallery_dl/extractor/twitter.py +++ b/gallery_dl/extractor/twitter.py @@ -1477,7 +1477,9 @@ class TwitterAPI(): def _pagination_legacy(self, endpoint, params): extr = self.extractor - params["cursor"] = extr._init_cursor() + cursor = extr._init_cursor() + if cursor: + params["cursor"] = cursor original_retweets = (extr.retweets == "original") bottom = ("cursor-bottom-", "sq-cursor-bottom") @@ -1577,7 +1579,9 @@ class TwitterAPI(): pinned_tweet = extr.pinned params = {"variables": None} - variables["cursor"] = extr._init_cursor() + cursor = extr._init_cursor() + if cursor: + variables["cursor"] = cursor if features is None: features = self.features_pagination if features: @@ -1770,7 +1774,9 @@ class TwitterAPI(): def _pagination_users(self, endpoint, variables, path=None): extr = self.extractor - variables["cursor"] = extr._init_cursor() + cursor = extr._init_cursor() + if cursor: + variables["cursor"] = cursor params = { "variables": None, "features" : self._json_dumps(self.features_pagination),