1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[twitter] send initial 'cursor' only when given via option

This commit is contained in:
Mike Fährmann 2024-07-09 20:40:40 +02:00
parent ff39d28ef4
commit 8e747b6dee
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -1477,7 +1477,9 @@ class TwitterAPI():
def _pagination_legacy(self, endpoint, params): def _pagination_legacy(self, endpoint, params):
extr = self.extractor extr = self.extractor
params["cursor"] = extr._init_cursor() cursor = extr._init_cursor()
if cursor:
params["cursor"] = cursor
original_retweets = (extr.retweets == "original") original_retweets = (extr.retweets == "original")
bottom = ("cursor-bottom-", "sq-cursor-bottom") bottom = ("cursor-bottom-", "sq-cursor-bottom")
@ -1577,7 +1579,9 @@ class TwitterAPI():
pinned_tweet = extr.pinned pinned_tweet = extr.pinned
params = {"variables": None} params = {"variables": None}
variables["cursor"] = extr._init_cursor() cursor = extr._init_cursor()
if cursor:
variables["cursor"] = cursor
if features is None: if features is None:
features = self.features_pagination features = self.features_pagination
if features: if features:
@ -1770,7 +1774,9 @@ class TwitterAPI():
def _pagination_users(self, endpoint, variables, path=None): def _pagination_users(self, endpoint, variables, path=None):
extr = self.extractor extr = self.extractor
variables["cursor"] = extr._init_cursor() cursor = extr._init_cursor()
if cursor:
variables["cursor"] = cursor
params = { params = {
"variables": None, "variables": None,
"features" : self._json_dumps(self.features_pagination), "features" : self._json_dumps(self.features_pagination),