Tumblr: fix title

This commit is contained in:
Mort Yao 2013-08-22 22:25:51 +02:00
parent 58a2dc90ee
commit 70cd7b3bd9

View File

@ -10,7 +10,9 @@ def tumblr_download(url, output_dir = '.', merge = True, info_only = False):
html = get_html(url) html = get_html(url)
html = parse.unquote(html).replace('\/', '/') html = parse.unquote(html).replace('\/', '/')
title = unescape_html(r1(r'<meta property="og:title" content="([^"]*)" />', html) or r1(r'<title>(.*)', html)) title = unescape_html(r1(r'<meta property="og:title" content="([^"]*)" />', html) or
r1(r'<meta property="og:description" content="([^"]*)" />', html) or
r1(r'<title>([^<\n]*)', html)).replace('\n', '')
real_url = r1(r'source src=\\x22([^\\]+)\\', html) real_url = r1(r'source src=\\x22([^\\]+)\\', html)
if not real_url: if not real_url:
real_url = r1(r'audio_file=([^&]+)&', html) + '?plead=please-dont-download-this-or-our-lawyers-wont-let-us-host-audio' real_url = r1(r'audio_file=([^&]+)&', html) + '?plead=please-dont-download-this-or-our-lawyers-wont-let-us-host-audio'