add support for Google+

This commit is contained in:
Mort Yao 2012-10-15 22:57:40 +02:00
parent 7ff89d01d2
commit 1c46a955a0
3 changed files with 30 additions and 0 deletions

View File

@ -4,6 +4,7 @@ from .acfun import *
from .bilibili import *
from .cntv import *
from .dailymotion import *
from .googleplus import *
from .ifeng import *
from .iqiyi import *
from .ku6 import *

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python
__all__ = ['googleplus_download']
from ..common import *
def googleplus_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url)
html = parse.unquote(html).replace('\/', '/')
title = r1(r'<title>(.*)\n', html)
url2 = r1(r'"(https\://plus\.google\.com/photos/.*?)",,"image/jpeg","video"\]', html)
html2 = get_html(url2)
html2 = parse.unquote(html2.replace('\/', '/'))
real_url = r1(r',\"(http://redirector.googlevideo.com/.*)\"]', html2)
real_url = unicodize(real_url)
type, ext, size = url_info(real_url)
print_info(site_info, title, type, size)
if not info_only:
download_urls([real_url], title, ext, size, output_dir, merge = merge)
site_info = "plus.google.com"
download = googleplus_download
download_playlist = playlist_not_supported('googleplus')

View File

@ -23,6 +23,7 @@ def url_to_module(url):
'bilibili': bilibili,
'cntv': cntv,
'dailymotion': dailymotion,
'google': googleplus,
'iask': sina,
'ifeng': ifeng,
'iqiyi': iqiyi,