[kemonoparty] fix 'comments' for posts without comments (#6415)

https://github.com/mikf/gallery-dl/issues/6415#issuecomment-2501966303
This commit is contained in:
Mike Fährmann
2024-11-26 23:23:39 +01:00
parent 74d855c693
commit 2162fa7df2
2 changed files with 23 additions and 5 deletions

View File

@@ -90,12 +90,19 @@ class KemonopartyExtractor(Extractor):
post["username"] = username
post["user_profile"] = profile
if comments:
post["comments"] = self.api.creator_post_comments(
service, creator_id, post["id"])
try:
post["comments"] = self.api.creator_post_comments(
service, creator_id, post["id"])
except exception.HttpError:
post["comments"] = ()
if dms is not None:
if dms is True:
dms = self.api.creator_dms(
post["service"], post["user"])
try:
dms = dms["props"]["dms"]
except Exception:
dms = ()
post["dms"] = dms
if announcements is not None:
if announcements is True: