Open fire-eggs opened 2 years ago
Mucking about a little more, supporting the "limit" parameter might actually be more useful, as it extends the number of entries returned. E.g.:
def note_list(self, body_matches=None, post_id=None, post_tags_match=None,
creator_name=None, creator_id=None, is_active=None, page=1, limit=20):
params = {
'search[body_matches]': body_matches,
'search[post_id]': post_id,
'search[post_tags_match]': post_tags_match,
'search[creator_name]': creator_name,
'search[creator_id]': creator_id,
'search[is_active]': is_active,
'page' : page,
'limit' : limit
}
return self._get('notes.json', params)
Detailed Description
The Danbooru API docs mention that all searches support a common set of parameters.
None of these common parameters are supported in api_danbooru.py.
I'm specifically interested in the "page" parameter.
Context
I am attempting to use pybooru to fetch notes for all posts [see my project Danbooru2019]. This because qwern doesn't include notes in his dataset.
Anywho, I found the note API will only return 20 notes for a given post. I.e. I'm using
pybooru
as follows:And this only returns 20 notes, whereas post id 77 actually has 21 notes.
So I need to be able to request pages to get all notes, e.g.:
Possible Implementation
Reworking
api_danbooru.py
,note_list
as follows appears to do the trick [documentation removed for conciseness]:Your Environment