Kemono Party - Support /posts endpoint and Creator Tag Calls#6833
Merged
mikf merged 1 commit intomikf:masterfrom Jan 21, 2025
Merged
Kemono Party - Support /posts endpoint and Creator Tag Calls#6833mikf merged 1 commit intomikf:masterfrom
mikf merged 1 commit intomikf:masterfrom
Conversation
Owner
|
No type hints, no f-strings, no re-indenting existing/unrelated code for no reason. |
Contributor
Author
|
91aedf4 to
dc4d577
Compare
- Adding support for calling a creator with a tag selected.
It is using a legacy endpoint but there is no other way currently
documented to get the users post filtered by a tag.
- Fixing the User Tags feature to be paginated
offset is not defined 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)
- Adding a type of caching mechanism for the metadata/user information.
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:
This builds a local cache during the process so it should
only make a call for the user info once during the process.
- Updating to meet standards
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)
- Fixing check for the length of response:
1. If it is list - just check len
2. If there is a key - check that the key length is less
than the batch.
- add test for '?tag=...' user URLs
plus some code simplifications
dc4d577 to
b11434a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.