add support for Vine.co, fix #134

This commit is contained in:
Mort Yao 2013-03-22 04:31:28 +01:00
parent df740c10e2
commit 9027ed92e0
3 changed files with 22 additions and 0 deletions

View File

@ -48,6 +48,7 @@ def url_to_module(url):
'tumblr': tumblr, 'tumblr': tumblr,
'vid48': vid48, 'vid48': vid48,
'vimeo': vimeo, 'vimeo': vimeo,
'vine': vine,
'xiami': xiami, 'xiami': xiami,
'yinyuetai': yinyuetai, 'yinyuetai': yinyuetai,
'youku': youku, 'youku': youku,

View File

@ -26,6 +26,7 @@ from .tudou import *
from .tumblr import * from .tumblr import *
from .vid48 import * from .vid48 import *
from .vimeo import * from .vimeo import *
from .vine import *
from .w56 import * from .w56 import *
from .xiami import * from .xiami import *
from .yinyuetai import * from .yinyuetai import *

View File

@ -0,0 +1,20 @@
#!/usr/bin/env python
__all__ = ['vine_download']
from ..common import *
def vine_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
title = r1(r'<meta property="og:title" content="([^"]*)"', html)
url = r1(r'<source src="([^"]*)"', html)
type, ext, size = url_info(url)
print_info(site_info, title, type, size)
if not info_only:
download_urls([url], title, ext, size, output_dir, merge = merge)
site_info = "Vine.co"
download = vine_download
download_playlist = playlist_not_supported('vine')