[booth] extract 'shop[id]' & 'shop[uuid]' metadata (#7920)

This commit is contained in:
Mike Fährmann
2025-07-29 20:16:58 +02:00
parent 78f81ee48a
commit a0b96bf0d6
2 changed files with 13 additions and 2 deletions

View File

@@ -56,8 +56,15 @@ class BoothItemExtractor(BoothExtractor):
item["published_at"], "%Y-%m-%dT%H:%M:%S.%f%z")
item["tags"] = [t["name"] for t in item["tags"]]
files = self._extract_files(item)
item["count"] = len(files)
shop = item["shop"]
shop["id"] = text.parse_int(shop["thumbnail_url"].rsplit("/", 3)[1])
if files := self._extract_files(item):
item["count"] = len(files)
shop["uuid"] = files[0]["url"].split("/", 4)[3]
else:
item["count"] = 0
shop["uuid"] = util.NONE
yield Message.Directory, item
for num, file in enumerate(files, 1):