Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kemono Party - Support /posts endpoint and Creator Tag Calls #6833

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

BishopRed90
Copy link

Hello,

I've added support for getting a creator that is filtered by a tag. The endpoint seems to be a legacy one as there is not an alternative.

I've also added some changes to support the /posts endpoint to work. It was failing if the config['metadata'] had been set due to it reaching out for a blank user/service id.

Fixed the pagination prematurely exiting also for those endpoints as they require a key for their results and the check was for the raw object.

It is using a legacy endpoint but there is no other way currently documented to get the users post filtered by a tag.
…in the API but it is supported.

Fixed the `/posts` endpoint not working:

1. Added check along with metadata to make sure there is a creator/service information as that is a requirement
2. Fixed the parameter from tags -> tag.
3. Fixed the _paginate call to exit correctly when there is a key required for the data (it was prematurely exiting)
The current logic would work just fine if looking up for a singular user, however for the multiple posts via normal filtering would cause it to either:

1. Error out due to lack of service and/or creator id.

2. Produce no metadata

This builds a local cache during the process so it should only make a call for the user info once during the process.
@mikf
Copy link
Owner

mikf commented Jan 15, 2025

No type hints, no f-strings, no re-indenting existing/unrelated code for no reason.

Fixes
1. Reset formatting for unnecessary line changes
2. Removed Type Hinting
3.Replaced f-string with "".format

Updates
Renamed function creator_posts_tags -> creator_tagged_posts for clarity of what it does (get posts tags vs get tagged posts)
@BishopRed90
Copy link
Author

  1. Removed Type Hints
  2. Replaced F-strings with "".format
  3. Restored indenting/formatting for unrelated code changes.

1. If it is list - just check len
2. If there is a key - check that the key length is less then the batch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants