Google+: download original video, fix #94

This commit is contained in:
Mort Yao 2013-02-01 23:28:24 +01:00
parent 1ca750ae55
commit 0773a1466e

View File

@ -20,32 +20,34 @@ def googleplus_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url2) html = get_html(url2)
html = parse.unquote(html.replace('\/', '/')) html = parse.unquote(html.replace('\/', '/'))
url_data = re.findall(r'(\[[^\[\"]+\"http://redirector.googlevideo.com/.*\"\])', html) real_url = unicodize(r1(r'"(https://video.googleusercontent.com/[^"]*)"', html).replace('\/', '/'))
if not real_url:
for itag in [ url_data = re.findall(r'(\[[^\[\"]+\"http://redirector.googlevideo.com/.*\"\])', html)
'38', for itag in [
'46', '37', '38',
'102', '45', '22', '46', '37',
'84', '102', '45', '22',
'120', '84',
'85', '120',
'44', '35', '85',
'101', '100', '43', '34', '82', '18', '44', '35',
'6', '101', '100', '43', '34', '82', '18',
'83', '5', '36', '6',
'17', '83', '5', '36',
'13', '17',
]: '13',
real_url = None ]:
for url_item in url_data: real_url = None
if itag == str(eval(url_item)[0]): for url_item in url_data:
real_url = eval(url_item)[3] if itag == str(eval(url_item)[0]):
real_url = eval(url_item)[3]
break
if real_url:
break break
if real_url: real_url = unicodize(real_url)
break
real_url = unicodize(real_url)
type, ext, size = url_info(real_url) _, _, size = url_info(real_url)
type, ext = 'video/mp4', 'mp4'
print_info(site_info, title, type, size) print_info(site_info, title, type, size)
if not info_only: if not info_only: