Skip to content

Commit

Permalink
[tumblr] recognize inline videos (#102)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikf committed Sep 6, 2018
1 parent 3ecea4c commit aa1de70
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gallery_dl/extractor/tumblr.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,16 @@ def items(self):
if "video_url" in post: # type: "video"
yield self._prepare(_original_video(post["video_url"]), post)

if self.inline: # inline images
if self.inline: # inline media
for key in ("body", "description", "source"):
if key in post:
for url in re.findall('<img src="([^"]+)"', post[key]):
url = _original_inline_image(url)
yield self._prepare_image(url, post)
if key not in post:
continue
for url in re.findall('<img src="([^"]+)"', post[key]):
url = _original_inline_image(url)
yield self._prepare_image(url, post)
for url in re.findall('<source src="([^"]+)"', post[key]):
url = _original_video(url)
yield self._prepare(url, post)

if self.external: # external links
post["extension"] = None
Expand Down

0 comments on commit aa1de70

Please sign in to comment.