qq compatible with new urls and modify baomihua getvidourl address

This commit is contained in:
zhangchao 2016-08-29 19:14:29 +08:00 committed by Mort Yao
parent 24b2b4cb55
commit 7baa1f029e
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ from ..common import *
import urllib
def baomihua_download_by_id(id, title=None, output_dir='.', merge=True, info_only=False, **kwargs):
html = get_html('http://play.baomihua.com/getvideourl.aspx?flvid=%s' % id)
html = get_html('http://play.baomihua.com/getvideourl.aspx?flvid=%s&devicetype=phone_app' % id)
host = r1(r'host=([^&]*)', html)
assert host
type = r1(r'videofiletype=([^&]*)', html)

View File

@ -50,7 +50,7 @@ def qq_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
else:
content = get_html(url)
vid = parse_qs(urlparse(url).query).get('vid') #for links specified vid like http://v.qq.com/cover/p/ps6mnfqyrfo7es3.html?vid=q0181hpdvo5
vid = vid[0] if vid else match1(content, r'vid\s*:\s*"\s*([^"]+)"') #general fallback
vid = vid[0] if vid else match1(content, r'vid"*\s*:\s*"\s*([^"]+)"') #general fallback
title = match1(content,r'<a.*?id\s*=\s*"%s".*?title\s*=\s*"(.+?)".*?>'%vid)
title = match1(content, r'title">([^"]+)</p>') if not title else title
title = match1(content, r'"title":"([^"]+)"') if not title else title