1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00

[pinterest] add count metadata field

This commit is contained in:
blankie 2023-12-28 01:06:48 +11:00
parent f9544194c0
commit 375f2db4c2
No known key found for this signature in database
GPG Key ID: CC15FC822C7F61F5

View File

@ -47,6 +47,7 @@ class PinterestExtractor(Extractor):
carousel_data = pin.get("carousel_data")
if carousel_data:
pin["count"] = len(carousel_data["carousel_slots"])
for num, slot in enumerate(carousel_data["carousel_slots"], 1):
slot["media_id"] = slot.pop("id")
pin.update(slot)
@ -65,7 +66,7 @@ class PinterestExtractor(Extractor):
if videos or media.get("duration") is None:
pin.update(media)
pin["num"] = 0
pin["num"] = pin["count"] = 1
pin["media_id"] = ""
url = media["url"]