diff --git a/gallery_dl/extractor/tumblr.py b/gallery_dl/extractor/tumblr.py index db949d0559..b694fa0dd5 100644 --- a/gallery_dl/extractor/tumblr.py +++ b/gallery_dl/extractor/tumblr.py @@ -102,8 +102,7 @@ def items(self): del post["trail"] post["blog"] = blog post["date"] = text.parse_timestamp(post["timestamp"]) - yield Message.Directory, post - post["num"] = 0 + posts = [] if "photos" in post: # type "photo" or "link" photos = post["photos"] @@ -125,15 +124,17 @@ def items(self): del photo["original_size"] del photo["alt_sizes"] - yield self._prepare_image(photo["url"], post) + posts.append( + self._prepare_image(photo["url"], post.copy())) + del post["photo"] url = post.get("audio_url") # type "audio" if url and url.startswith("https://a.tumblr.com/"): - yield self._prepare(url, post) + posts.append(self._prepare(url, post.copy())) url = post.get("video_url") # type "video" if url: - yield self._prepare(_original_video(url), post) + posts.append(self._prepare(_original_video(url), post.copy())) if self.inline and "reblog" in post: # inline media # only "chat" posts are missing a "reblog" key in their @@ -141,16 +142,25 @@ def items(self): body = post["reblog"]["comment"] + post["reblog"]["tree_html"] for url in re.findall('