mirror of
https://github.com/soimort/you-get.git
synced 2025-01-23 21:45:02 +03:00
[vine] support card URLs
This commit is contained in:
parent
53fface1f9
commit
20e9ef4708
@ -8,10 +8,11 @@ def vine_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
|
||||
html = get_html(url)
|
||||
|
||||
vid = r1(r'vine.co/v/([^/]+)', url)
|
||||
title1 = r1(r'<meta property="twitter:title" content="([^"]*)"', html)
|
||||
title2 = r1(r'<meta property="twitter:description" content="([^"]*)"', html)
|
||||
title = "{} - {} [{}]".format(title1, title2, vid)
|
||||
title = r1(r'<title>([^<]*)</title>', html)
|
||||
stream = r1(r'<meta property="twitter:player:stream" content="([^"]*)">', html)
|
||||
if not stream: # https://vine.co/v/.../card
|
||||
stream = r1(r'"videoUrl":"([^"]+)"', html).replace('\\/', '/')
|
||||
|
||||
mime, ext, size = url_info(stream)
|
||||
|
||||
print_info(site_info, title, mime, size)
|
||||
|
Loading…
Reference in New Issue
Block a user