mikf / gallery-dl

Command-line program to download image galleries and collections from several image hosting sites
GNU General Public License v2.0
11.49k stars 941 forks source link

[Civitai] Image ID not available for all Civitai extractors. #6251

Closed austblack88 closed 1 day ago

austblack88 commented 3 days ago

I noticed that, when scraping images, the image id keyword isn't available for every subcategory in the Civitai extractor. For instance, it will be available for the "user-images" extractor:

...
hash
  U9C?Gs^*009G%L~Vs;4:00WV?bxa_3D*D%%M
height
  1024
**id**
  383346
meta
  None
...

but not for the "model" extractor (like when extracting images from a model's gallery).

Would it be feasible to include this in the other extractors?

mikf commented 3 days ago

For "api": "rest" (default), the numeric ID should be available as filename. I should probably give it a proper id name, though.

austblack88 commented 3 days ago

For "api": "rest" (default), the numeric ID should be available as filename. I should probably give it a proper id name, though.

I did try to fall back on the filename, but it's not always the same as the image id.

mikf commented 2 days ago

With https://github.com/mikf/gallery-dl/commit/987f6c36c0d48d870acafac4dd24ded13641147c, all model images have a numeric {file[id]} value, and all regular images an {id} one; {file[id]|id} in general.

mikf commented 1 day ago

Even without https://github.com/mikf/gallery-dl/commit/987f6c36c0d48d870acafac4dd24ded13641147c, you should be able to get the ID value with {file[id]|id|filename} and/or by using -o api=trpc.