mirror of
https://github.com/mikf/gallery-dl.git
synced 2024-11-23 03:02:50 +01:00
[artstation] add 'num' and 'count' metadata fields (#2764)
This commit is contained in:
parent
0c73914848
commit
59b16b3f70
@ -32,9 +32,11 @@ class ArtstationExtractor(Extractor):
|
||||
data = self.metadata()
|
||||
|
||||
for project in self.projects():
|
||||
for asset in self.get_project_assets(project["hash_id"]):
|
||||
for num, asset in enumerate(
|
||||
self.get_project_assets(project["hash_id"]), 1):
|
||||
asset.update(data)
|
||||
adict = asset["asset"]
|
||||
asset["num"] = num
|
||||
yield Message.Directory, asset
|
||||
|
||||
if adict["has_embedded_player"] and self.external:
|
||||
@ -85,6 +87,7 @@ class ArtstationExtractor(Extractor):
|
||||
assets = data["assets"]
|
||||
del data["assets"]
|
||||
|
||||
data["count"] = len(assets)
|
||||
if len(assets) == 1:
|
||||
data["asset"] = assets[0]
|
||||
yield data
|
||||
|
Loading…
Reference in New Issue
Block a user