1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

[pinterest] support 'story_pin_music_block' blocks (#6421)

This commit is contained in:
Mike Fährmann 2024-11-05 13:57:25 +01:00
parent 0b3ddd01af
commit a9a9f3a180
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88
2 changed files with 15 additions and 0 deletions

View File

@ -122,6 +122,11 @@ class PinterestExtractor(Extractor):
media = self._extract_video(video) media = self._extract_video(video)
media["media_id"] = video.get("id") or "" 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": elif type == "story_pin_paragraph_block":
media = {"url": "text:" + block["text"], media = {"url": "text:" + block["text"],
"extension": "txt", "extension": "txt",

View File

@ -49,6 +49,16 @@ __tests__ = (
"_ytdl_manifest": "hls", "_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/", "#url" : "https://jp.pinterest.com/pin/851532242064221228/",
"#comment" : "story pin with text", "#comment" : "story pin with text",