Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

修复acfun.py下载的代码 #72

Open
datou06415 opened this issue Aug 11, 2013 · 1 comment
Open

修复acfun.py下载的代码 #72

datou06415 opened this issue Aug 11, 2013 · 1 comment

Comments

@datou06415
Copy link

需要修改的是acfun.py中的acfun_download函数, 以下有两处需要修改,拷贝粘贴后注意缩进问题:
1 - 在获取title的语句和assert title的语句之间,插入如下两行,部分视频标题嵌在这儿
(好像还有其他的地方也可以获取,不过标题不是问题)
if not title:
title = r1(r'<h\d id="title-article" class="title"[^<>]*>([^<>]+)</h\d>', html)

2 - 在该函数结束前,有一个获取id的语句,改成
id = r1(r'Video[/Video]', html)

@datou06415
Copy link
Author

更正一下:
上述第二个修改的地方,正则表达式应该设置ignorecase的标志,不使用作者的r1函数,直接将上述语句改为:
id = re.search(r'video[/video]', html, re.I).group(1)

(* 注意缩进×)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant