mirror of
https://github.com/soimort/you-get.git
synced 2025-03-13 11:24:02 +03:00
Support for tumblr-hosted videos.
This commit is contained in:
parent
d1eb858fcc
commit
5aa7b87dce
@ -67,21 +67,26 @@ def tumblr_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
|||||||
if not real_url:
|
if not real_url:
|
||||||
real_url = r1(r'<source src="([^"]*)"', html)
|
real_url = r1(r'<source src="([^"]*)"', html)
|
||||||
if not real_url:
|
if not real_url:
|
||||||
iframe_url = r1(r'<iframe[^>]+src=[\'"]([^\'"]*)[\'"]', html)
|
iframe_url = r1(r'<[^>]+tumblr_video_container[^>]+><iframe[^>]+src=[\'"]([^\'"]*)[\'"]', html)
|
||||||
if iframe_url[:2] == '//': iframe_url = 'http:' + iframe_url
|
if len(iframe_url) > 0:
|
||||||
if re.search(r'player\.vimeo\.com', iframe_url):
|
iframe_html = get_content(iframe_url, headers=fake_headers)
|
||||||
vimeo_download(iframe_url, output_dir, merge=merge, info_only=info_only,
|
real_url = r1(r'<video[^>]*>[\n ]*<source[^>]+src=[\'"]([^\'"]*)[\'"]', iframe_html)
|
||||||
referer='http://tumblr.com/', **kwargs)
|
|
||||||
return
|
|
||||||
elif re.search(r'dailymotion\.com', iframe_url):
|
|
||||||
dailymotion_download(iframe_url, output_dir, merge=merge, info_only=info_only, **kwargs)
|
|
||||||
return
|
|
||||||
elif re.search(r'vine\.co', iframe_url):
|
|
||||||
vine_download(iframe_url, output_dir, merge=merge, info_only=info_only, **kwargs)
|
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
iframe_html = get_content(iframe_url)
|
iframe_url = r1(r'<iframe[^>]+src=[\'"]([^\'"]*)[\'"]', html)
|
||||||
real_url = r1(r'<source src="([^"]*)"', iframe_html)
|
if iframe_url[:2] == '//': iframe_url = 'http:' + iframe_url
|
||||||
|
if re.search(r'player\.vimeo\.com', iframe_url):
|
||||||
|
vimeo_download(iframe_url, output_dir, merge=merge, info_only=info_only,
|
||||||
|
referer='http://tumblr.com/', **kwargs)
|
||||||
|
return
|
||||||
|
elif re.search(r'dailymotion\.com', iframe_url):
|
||||||
|
dailymotion_download(iframe_url, output_dir, merge=merge, info_only=info_only, **kwargs)
|
||||||
|
return
|
||||||
|
elif re.search(r'vine\.co', iframe_url):
|
||||||
|
vine_download(iframe_url, output_dir, merge=merge, info_only=info_only, **kwargs)
|
||||||
|
return
|
||||||
|
else:
|
||||||
|
iframe_html = get_content(iframe_url)
|
||||||
|
real_url = r1(r'<source src="([^"]*)"', iframe_html)
|
||||||
|
|
||||||
title = unescape_html(r1(r'<meta property="og:title" content="([^"]*)" />', html) or
|
title = unescape_html(r1(r'<meta property="og:title" content="([^"]*)" />', html) or
|
||||||
r1(r'<meta property="og:description" content="([^"]*)" />', html) or
|
r1(r'<meta property="og:description" content="([^"]*)" />', html) or
|
||||||
|
Loading…
x
Reference in New Issue
Block a user