mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
[vine] fix support
This commit is contained in:
parent
3d6e6effa1
commit
6886c5ace1
@ -7,18 +7,16 @@ from ..common import *
|
|||||||
def vine_download(url, output_dir='.', merge=True, info_only=False):
|
def vine_download(url, output_dir='.', merge=True, info_only=False):
|
||||||
html = get_html(url)
|
html = get_html(url)
|
||||||
|
|
||||||
vid = r1(r'vine.co/v/([^/]+)/', html)
|
vid = r1(r'vine.co/v/([^/]+)', url)
|
||||||
title1 = r1(r'<meta property="twitter:title" content="([^"]*)"', html)
|
title1 = r1(r'<meta property="twitter:title" content="([^"]*)"', html)
|
||||||
title2 = r1(r'<meta property="twitter:description" content="([^"]*)"', html)
|
title2 = r1(r'<meta property="twitter:description" content="([^"]*)"', html)
|
||||||
title = "%s - %s" % (title1, title2) + " [" + vid + "]"
|
title = "{} - {} [{}]".format(title1, title2, vid)
|
||||||
url = r1(r'<source src="([^"]*)"', html) or r1(r'<meta itemprop="contentUrl" content="([^"]*)"', html)
|
stream = r1(r'<meta property="twitter:player:stream" content="([^"]*)">', html)
|
||||||
if url[0:2] == "//":
|
mime, ext, size = url_info(stream)
|
||||||
url = "http:" + url
|
|
||||||
type, ext, size = url_info(url)
|
|
||||||
|
|
||||||
print_info(site_info, title, type, size)
|
print_info(site_info, title, mime, size)
|
||||||
if not info_only:
|
if not info_only:
|
||||||
download_urls([url], title, ext, size, output_dir, merge = merge)
|
download_urls([stream], title, ext, size, output_dir, merge=merge)
|
||||||
|
|
||||||
site_info = "Vine.co"
|
site_info = "Vine.co"
|
||||||
download = vine_download
|
download = vine_download
|
||||||
|
Loading…
Reference in New Issue
Block a user