[twitter] add 'limit' option (#8173)
- reduce default number of requested items to 50 - allow using "fallback" values like with 'search-limit' https://github.com/mikf/gallery-dl/issues/8173#issuecomment-3303015837
This commit is contained in:
@@ -6215,6 +6215,23 @@ Description
|
|||||||
* ``360x360``
|
* ``360x360``
|
||||||
|
|
||||||
|
|
||||||
|
extractor.twitter.limit
|
||||||
|
-----------------------
|
||||||
|
Type
|
||||||
|
* ``integer``
|
||||||
|
* ``list`` of ``integers``
|
||||||
|
Default
|
||||||
|
``50``
|
||||||
|
Example
|
||||||
|
``[40, 30, 20, 10, 5]``
|
||||||
|
Description
|
||||||
|
Number of requested results per API query.
|
||||||
|
|
||||||
|
When given as a ``list``,
|
||||||
|
start with the first element as ``count`` parameter
|
||||||
|
and switch to the next element whenever no results are returned.
|
||||||
|
|
||||||
|
|
||||||
extractor.twitter.logout
|
extractor.twitter.logout
|
||||||
------------------------
|
------------------------
|
||||||
Type
|
Type
|
||||||
|
|||||||
@@ -871,6 +871,7 @@
|
|||||||
"cursor" : true,
|
"cursor" : true,
|
||||||
"expand" : false,
|
"expand" : false,
|
||||||
"include" : ["timeline"],
|
"include" : ["timeline"],
|
||||||
|
"limit" : 50,
|
||||||
"locked" : "abort",
|
"locked" : "abort",
|
||||||
"logout" : true,
|
"logout" : true,
|
||||||
"pinned" : false,
|
"pinned" : false,
|
||||||
|
|||||||
@@ -1370,7 +1370,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/E8Wq-_jFSaU7hxVcuOPR9g/UserTweets"
|
endpoint = "/graphql/E8Wq-_jFSaU7hxVcuOPR9g/UserTweets"
|
||||||
variables = {
|
variables = {
|
||||||
"userId": self._user_id_by_screen_name(screen_name),
|
"userId": self._user_id_by_screen_name(screen_name),
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"withQuickPromoteEligibilityTweetFields": False,
|
"withQuickPromoteEligibilityTweetFields": False,
|
||||||
"withVoice": True,
|
"withVoice": True,
|
||||||
@@ -1385,7 +1385,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/-O3QOHrVn1aOm_cF5wyTCQ/UserTweetsAndReplies"
|
endpoint = "/graphql/-O3QOHrVn1aOm_cF5wyTCQ/UserTweetsAndReplies"
|
||||||
variables = {
|
variables = {
|
||||||
"userId": self._user_id_by_screen_name(screen_name),
|
"userId": self._user_id_by_screen_name(screen_name),
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"withCommunity": True,
|
"withCommunity": True,
|
||||||
"withVoice": True,
|
"withVoice": True,
|
||||||
@@ -1400,7 +1400,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/gmHw9geMTncZ7jeLLUUNOw/UserHighlightsTweets"
|
endpoint = "/graphql/gmHw9geMTncZ7jeLLUUNOw/UserHighlightsTweets"
|
||||||
variables = {
|
variables = {
|
||||||
"userId": self._user_id_by_screen_name(screen_name),
|
"userId": self._user_id_by_screen_name(screen_name),
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"withVoice": True,
|
"withVoice": True,
|
||||||
}
|
}
|
||||||
@@ -1414,7 +1414,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/jCRhbOzdgOHp6u9H4g2tEg/UserMedia"
|
endpoint = "/graphql/jCRhbOzdgOHp6u9H4g2tEg/UserMedia"
|
||||||
variables = {
|
variables = {
|
||||||
"userId": self._user_id_by_screen_name(screen_name),
|
"userId": self._user_id_by_screen_name(screen_name),
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"withClientEventToken": False,
|
"withClientEventToken": False,
|
||||||
"withBirdwatchNotes": False,
|
"withBirdwatchNotes": False,
|
||||||
@@ -1430,7 +1430,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/TGEKkJG_meudeaFcqaxM-Q/Likes"
|
endpoint = "/graphql/TGEKkJG_meudeaFcqaxM-Q/Likes"
|
||||||
variables = {
|
variables = {
|
||||||
"userId": self._user_id_by_screen_name(screen_name),
|
"userId": self._user_id_by_screen_name(screen_name),
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"withClientEventToken": False,
|
"withClientEventToken": False,
|
||||||
"withBirdwatchNotes": False,
|
"withBirdwatchNotes": False,
|
||||||
@@ -1445,7 +1445,7 @@ class TwitterAPI():
|
|||||||
def user_bookmarks(self):
|
def user_bookmarks(self):
|
||||||
endpoint = "/graphql/pLtjrO4ubNh996M_Cubwsg/Bookmarks"
|
endpoint = "/graphql/pLtjrO4ubNh996M_Cubwsg/Bookmarks"
|
||||||
variables = {
|
variables = {
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
}
|
}
|
||||||
return self._pagination_tweets(
|
return self._pagination_tweets(
|
||||||
@@ -1508,7 +1508,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/Nyt-88UX4-pPCImZNUl9RQ/CommunityTweetsTimeline"
|
endpoint = "/graphql/Nyt-88UX4-pPCImZNUl9RQ/CommunityTweetsTimeline"
|
||||||
variables = {
|
variables = {
|
||||||
"communityId": community_id,
|
"communityId": community_id,
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"displayLocation": "Community",
|
"displayLocation": "Community",
|
||||||
"rankingMode": "Recency",
|
"rankingMode": "Recency",
|
||||||
"withCommunity": True,
|
"withCommunity": True,
|
||||||
@@ -1522,7 +1522,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/ZniZ7AAK_VVu1xtSx1V-gQ/CommunityMediaTimeline"
|
endpoint = "/graphql/ZniZ7AAK_VVu1xtSx1V-gQ/CommunityMediaTimeline"
|
||||||
variables = {
|
variables = {
|
||||||
"communityId": community_id,
|
"communityId": community_id,
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"withCommunity": True,
|
"withCommunity": True,
|
||||||
}
|
}
|
||||||
return self._pagination_tweets(
|
return self._pagination_tweets(
|
||||||
@@ -1534,7 +1534,7 @@ class TwitterAPI():
|
|||||||
endpoint = ("/graphql/p048a9n3hTPppQyK7FQTFw"
|
endpoint = ("/graphql/p048a9n3hTPppQyK7FQTFw"
|
||||||
"/CommunitiesMainPageTimeline")
|
"/CommunitiesMainPageTimeline")
|
||||||
variables = {
|
variables = {
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"withCommunity": True,
|
"withCommunity": True,
|
||||||
}
|
}
|
||||||
return self._pagination_tweets(
|
return self._pagination_tweets(
|
||||||
@@ -1544,7 +1544,7 @@ class TwitterAPI():
|
|||||||
def home_timeline(self):
|
def home_timeline(self):
|
||||||
endpoint = "/graphql/DXmgQYmIft1oLP6vMkJixw/HomeTimeline"
|
endpoint = "/graphql/DXmgQYmIft1oLP6vMkJixw/HomeTimeline"
|
||||||
variables = {
|
variables = {
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"latestControlAvailable": True,
|
"latestControlAvailable": True,
|
||||||
"withCommunity": True,
|
"withCommunity": True,
|
||||||
@@ -1555,7 +1555,7 @@ class TwitterAPI():
|
|||||||
def home_latest_timeline(self):
|
def home_latest_timeline(self):
|
||||||
endpoint = "/graphql/SFxmNKWfN9ySJcXG_tjX8g/HomeLatestTimeline"
|
endpoint = "/graphql/SFxmNKWfN9ySJcXG_tjX8g/HomeLatestTimeline"
|
||||||
variables = {
|
variables = {
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
"includePromotedContent": False,
|
"includePromotedContent": False,
|
||||||
"latestControlAvailable": True,
|
"latestControlAvailable": True,
|
||||||
}
|
}
|
||||||
@@ -1582,7 +1582,7 @@ class TwitterAPI():
|
|||||||
endpoint = "/graphql/06JtmwM8k_1cthpFZITVVA/ListLatestTweetsTimeline"
|
endpoint = "/graphql/06JtmwM8k_1cthpFZITVVA/ListLatestTweetsTimeline"
|
||||||
variables = {
|
variables = {
|
||||||
"listId": list_id,
|
"listId": list_id,
|
||||||
"count": 100,
|
"count": self.extractor.config("limit", 50),
|
||||||
}
|
}
|
||||||
return self._pagination_tweets(
|
return self._pagination_tweets(
|
||||||
endpoint, variables, ("list", "tweets_timeline", "timeline"))
|
endpoint, variables, ("list", "tweets_timeline", "timeline"))
|
||||||
|
|||||||
Reference in New Issue
Block a user