[reddit] add 'limit' option (#7997 #8012 #8092)

change default value from 100 to null,
i.e. don't send a 'limit' parameter
This commit is contained in:
Mike Fährmann
2025-08-28 22:55:29 +02:00
parent 2eca790c87
commit de05453707
3 changed files with 20 additions and 2 deletions

View File

@@ -426,13 +426,11 @@ class RedditAPI():
def submissions_subreddit(self, subreddit, params):
"""Collect all (submission, comments)-tuples of a subreddit"""
endpoint = subreddit + "/.json"
params["limit"] = 100
return self._pagination(endpoint, params)
def submissions_user(self, user, params):
"""Collect all (submission, comments)-tuples posted by a user"""
endpoint = "/user/" + user + "/.json"
params["limit"] = 100
return self._pagination(endpoint, params)
def morechildren(self, link_id, children):
@@ -532,6 +530,9 @@ class RedditAPI():
id_max = float("inf")
date_min, date_max = self.extractor._get_date_min_max(0, 253402210800)
if limit := self.extractor.config("limit"):
params["limit"] = limit
while True:
data = self._call(endpoint, params)["data"]