[booth] extract 'shop[id]' & 'shop[uuid]' metadata (#7920)
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -69,6 +69,8 @@ https://www.melonbooks.co.jp/detail/detail.php?product_id=1872452""",
|
||||
},
|
||||
"shipping_info" : "支払いから発送までの日数:4日以内",
|
||||
"shop" : {
|
||||
"id" : 5742915,
|
||||
"uuid" : "792d497b-6e82-4df3-86de-31577e10f476",
|
||||
"name" : "ふたりぼっちのSolitude",
|
||||
"subdomain" : "wanoazayaka",
|
||||
"thumbnail_url": "https://booth.pximg.net/c/48x48/users/5742915/icon_image/1448e5d8-f93f-445e-8e1e-acb29aa45aa4_base_resized.jpg",
|
||||
@@ -162,6 +164,8 @@ https://www.melonbooks.co.jp/detail/detail.php?product_id=1872452""",
|
||||
},
|
||||
},
|
||||
"shop" : {
|
||||
"id" : 49832,
|
||||
"uuid" : "74488d0d-e533-443c-82ce-fa961d5cbaf0",
|
||||
"name" : "CARAMEL CRUNCH!",
|
||||
"subdomain" : "caramel-crunch",
|
||||
"thumbnail_url": "https://booth.pximg.net/c/48x48/users/49832/icon_image/a240e313-6a0f-4155-8310-a0d6abb299e6_base_resized.jpg",
|
||||
|
||||
Reference in New Issue
Block a user