From a9a9f3a180baf587f0e0940550bfcd5ab1407ba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Tue, 5 Nov 2024 13:57:25 +0100 Subject: [PATCH] [pinterest] support 'story_pin_music_block' blocks (#6421) --- gallery_dl/extractor/pinterest.py | 5 +++++ test/results/pinterest.py | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py index 499c579d..2f0d355d 100644 --- a/gallery_dl/extractor/pinterest.py +++ b/gallery_dl/extractor/pinterest.py @@ -122,6 +122,11 @@ class PinterestExtractor(Extractor): media = self._extract_video(video) media["media_id"] = video.get("id") or "" + elif type == "story_pin_music_block": + media = block["audio"] + media["url"] = media["audio_url"] + media["media_id"] = media.get("id") or "" + elif type == "story_pin_paragraph_block": media = {"url": "text:" + block["text"], "extension": "txt", diff --git a/test/results/pinterest.py b/test/results/pinterest.py index 8436c4aa..3ab5ebb3 100644 --- a/test/results/pinterest.py +++ b/test/results/pinterest.py @@ -49,6 +49,16 @@ __tests__ = ( "_ytdl_manifest": "hls", }, +{ + "#url" : "https://www.pinterest.com/pin/606508274845593025/", + "#comment" : "story pin with audio (#6188)", + "#class" : pinterest.PinterestPinExtractor, + "#range" : "2", + "#urls" : "https://v1.pinimg.com/audios/mp3/5d/37/74/5d37749bde03855c1292f8869c8d9387.mp3", + + "extension": "mp3", +}, + { "#url" : "https://jp.pinterest.com/pin/851532242064221228/", "#comment" : "story pin with text",