Skip to content

Commit

Permalink
merge #4981: [pinterest] add 'count' metadata field
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Dec 30, 2023
2 parents f36dafa + 375f2db commit 9f5051e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gallery_dl/extractor/pinterest.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def items(self):

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)
Expand All @@ -65,7 +66,7 @@ def items(self):

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"]
Expand Down

0 comments on commit 9f5051e

Please sign in to comment.