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

[Civitai] CivitaiImageExtractor not working as intended. #6279

Closed
austblack88 opened this issue Oct 5, 2024 · 3 comments
Closed

[Civitai] CivitaiImageExtractor not working as intended. #6279

austblack88 opened this issue Oct 5, 2024 · 3 comments

Comments

@austblack88
Copy link

I noticed that whenever this subcategory is used for this extractor, the result is a massive list of random images across the site, rather than the intended target image.
I looked at the call being made for this subcategory, and it looks like the parameter imageId is included. Example with https://civitai.com/images/2478631:

[urllib3.connectionpool][debug] https://civitai.com:443 "GET /api/v1/images?imageId=2478631&nsfw=X HTTP/1.1" 200 None
...
[urllib3.connectionpool][debug] https://civitai.com:443 "GET /api/v1/images?imageId=2478631&nsfw=X&cursor=50%7C1676913378886 HTTP/1.1" 200 None
...
etc.

but this parameter is not included in the list of available parameters on the Civitai API reference: GET /api/v1/images
which I suspect may be the reason this issue is occurring.

However, there is a postID parameter that can be utilized. This is just a suggestion, but If it's not feasible to be able to extract the target image through the API, it might be more worthwhile to change this subcategory to CivitaiPostExtractor that would be used for extracting images from a post, from URLs like this: https://civitai.com/posts/592634 .

@austblack88 austblack88 changed the title [Civitai] CivitaiImageExtractor not working as inteded. [Civitai] CivitaiImageExtractor not working as intended. Oct 5, 2024
@mikf
Copy link
Owner

mikf commented Oct 5, 2024

The imageId parameter was working previously and it usually (civitai/civitai#1329) downloaded the correct image, but now it seems to get ignored and /api/v1/images downloads everything there is without any filter.

Just use the tRPC API endpoints (-o api=trpc). They are undocumented, but at least they support every site feature since they are what gets used internally by the site itself.

it might be more worthwhile to change this subcategory to CivitaiPostExtractor that would be used for extracting images from a post, from URLs like this: https://civitai.com/posts/592634 .

Posts are currently not supported.

@austblack88
Copy link
Author

Ah I didn't consider trpc. I'll work with that then, thanks!

@mikf
Copy link
Owner

mikf commented Oct 7, 2024

tRPC API is now the default (b12d65a) and posts are supported (9757eac)

@mikf mikf closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants