[instagram] fix support

This commit is contained in:
Mort Yao 2015-06-14 00:12:28 +08:00
parent 6886c5ace1
commit b375576d5e

View File

@ -7,15 +7,15 @@ from ..common import *
def instagram_download(url, output_dir = '.', merge = True, info_only = False): def instagram_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url) html = get_html(url)
vid = r1(r'instagram.com/p/([^/]+)/', html) vid = r1(r'instagram.com/p/([^/]+)', url)
description = r1(r'<meta property="og:description" content="([^"]*)"', html) description = r1(r'<meta property="og:title" content="([^"]*)"', html)
title = description + " [" + vid + "]" title = "{} [{}]".format(description.replace("\n", " "), vid)
url = r1(r'<meta property="og:video" content="([^"]*)"', html) stream = r1(r'<meta property="og:video" content="([^"]*)"', html)
type, ext, size = url_info(url) mime, ext, size = url_info(stream)
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 = "Instagram.com" site_info = "Instagram.com"
download = instagram_download download = instagram_download