[sina]try to find vid from url

This commit is contained in:
MaxwellGoblin 2017-05-18 03:50:07 +08:00
parent b646c851a0
commit f1823eb16a

View File

@ -77,6 +77,10 @@ def sina_download(url, output_dir='.', merge=True, info_only=False, **kwargs):
sina_download_by_vid(vid, title=title, output_dir=output_dir, merge=merge, info_only=info_only)
else:
vkey = match1(video_page, r'vkey\s*:\s*"([^"]+)"')
if vkey is None:
vid = match1(url, r'#(\d+)')
sina_download_by_vid(vid, output_dir=output_dir, merge=merge, info_only=info_only)
return
title = match1(video_page, r'title\s*:\s*"([^"]+)"')
sina_download_by_vkey(vkey, title=title, output_dir=output_dir, merge=merge, info_only=info_only)