1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 02:32:33 +01:00

[civitai] fix "My Reactions" results (#6263)

requires 'api-key' or authenticated cookies to work
This commit is contained in:
Mike Fährmann 2024-10-16 23:01:48 +02:00
parent 69a75b1de2
commit 4b31601dc0
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 25 additions and 2 deletions

View File

@ -356,8 +356,20 @@ class CivitaiUserImagesExtractor(CivitaiExtractor):
example = "https://civitai.com/user/USER/images"
def images(self):
params = text.parse_query(self.groups[1])
params["username"] = text.unquote(self.groups[0])
params = text.parse_query_list(self.groups[1])
if params.get("section") == "reactions":
params["authed"] = True
params["useIndex"] = False
if "reactions" in params:
if isinstance(params["reactions"], str):
params["reactions"] = (params["reactions"],)
else:
params["reactions"] = (
"Like", "Dislike", "Heart", "Laugh", "Cry")
else:
params["username"] = text.unquote(self.groups[0])
return self.api.images(params)

View File

@ -176,4 +176,15 @@ __tests__ = (
"#count" : 50,
},
{
"#url" : "https://civitai.com/user/USER/images?section=reactions",
"#class": civitai.CivitaiUserImagesExtractor,
"#auth" : True,
"#urls" : (
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/dd29c97a-1e95-4186-8df5-632736cbae79/original=true/00012-2489035818.png",
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/5c4efa68-bb58-47c5-a716-98cd0f51f047/original=true/00013-4238863814.png",
"https://image.civitai.com/xG1nkqKTMzGDvpLrqFT7WA/69bf3279-df2c-4ec8-b795-479e9cd3db1b/original=true/00014-3150861441.png",
),
},
)