some url like this http://kuaibao.qq.com/s/SPO2016050503989500 got the title failed will raise exception

This commit is contained in:
Xiaobing Yu 2016-05-06 18:41:11 +08:00
parent 2768867965
commit b9428bd9c7

View File

@ -32,7 +32,8 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
elif 'kuaibao.qq.com' in url:
content = get_html(url)
vid = match1(content, r'vid\s*=\s*"\s*([^"]+)"')
title = match1(content, r'title">([^"]+)</p>').strip()
title = match1(content, r'title">([^"]+)</p>')
title = title.strip() if title else vid
elif 'iframe/player.html' in url:
vid = match1(url, r'\bvid=(\w+)')
# for embedded URLs; don't know what the title is