Support for tumblr-hosted videos.

This commit is contained in:
Sleaze 2016-02-29 15:59:04 -08:00
parent d1eb858fcc
commit 5aa7b87dce

View File

@ -67,6 +67,11 @@ def tumblr_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
if not real_url:
real_url = r1(r'<source src="([^"]*)"', html)
if not real_url:
iframe_url = r1(r'<[^>]+tumblr_video_container[^>]+><iframe[^>]+src=[\'"]([^\'"]*)[\'"]', html)
if len(iframe_url) > 0:
iframe_html = get_content(iframe_url, headers=fake_headers)
real_url = r1(r'<video[^>]*>[\n ]*<source[^>]+src=[\'"]([^\'"]*)[\'"]', iframe_html)
else:
iframe_url = r1(r'<iframe[^>]+src=[\'"]([^\'"]*)[\'"]', html)
if iframe_url[:2] == '//': iframe_url = 'http:' + iframe_url
if re.search(r'player\.vimeo\.com', iframe_url):