Skip to content

Commit

Permalink
[twitter] send initial 'cursor' only when given via option
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Jul 9, 2024
1 parent ff39d28 commit 8e747b6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gallery_dl/extractor/twitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,9 @@ def _call(self, endpoint, params, method="GET", auth=True, root=None):

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")

Expand Down Expand Up @@ -1577,7 +1579,9 @@ def _pagination_tweets(self, endpoint, variables,
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:
Expand Down Expand Up @@ -1770,7 +1774,9 @@ def _pagination_tweets(self, endpoint, variables,

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),
Expand Down

0 comments on commit 8e747b6

Please sign in to comment.