From 3bdfc15be1ad9fc66db6ccac1e053a34bb19787c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Wed, 14 Nov 2018 11:34:24 +0100 Subject: [PATCH] [pinterest] don't crash on pins without image info --- gallery_dl/extractor/8chan.py | 2 +- gallery_dl/extractor/pinterest.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/gallery_dl/extractor/8chan.py b/gallery_dl/extractor/8chan.py index 7c266a43..53929b0a 100644 --- a/gallery_dl/extractor/8chan.py +++ b/gallery_dl/extractor/8chan.py @@ -18,7 +18,7 @@ class InfinitychanThreadExtractor(chan.ChanThreadExtractor): pattern = [r"(?:https?://)?(?:www\.)?8ch\.net/([^/]+)/res/(\d+)"] test = [("https://8ch.net/builders/res/3.html", { "url": "5d85c0509f907f217aea379f862b41bf3d01f645", - "keyword": "c065d10c3552b2cb663579a8e88cf0777b1b770b", + "keyword": "0c497190c0c0f826925fde09815351d01869c783", })] api_url = "https://8ch.net/{board}/res/{thread}.json" file_url = "https://media.8ch.net/{board}/src/{tim}{ext}" diff --git a/gallery_dl/extractor/pinterest.py b/gallery_dl/extractor/pinterest.py index 04984c7a..8672eb4b 100644 --- a/gallery_dl/extractor/pinterest.py +++ b/gallery_dl/extractor/pinterest.py @@ -32,9 +32,10 @@ class PinterestExtractor(Extractor): yield Message.Directory, data for pin in self.pins(): - url, pin_data = self.data_from_pin(pin) - pin_data.update(data) - yield Message.Url, url, pin_data + if "images" in pin: + url, pin_data = self.data_from_pin(pin) + pin_data.update(data) + yield Message.Url, url, pin_data def metadata(self): """Return general metadata"""