|
发表于 2018-3-14 21:25:49
|
显示全部楼层
ehane 发表于 2018-3-16 14:37
flag 就是开始爬的页数。你查一下看你爬到哪个文件,搜一下在第几页,把记得flag设置在下一页,不然肯定b ...
如果要从60页开始,是改flag =60吗,改了后脚本一直没输出。改回原来=1,就可以正常输出信息
def run():
s=spider(quality)
reqget=s.req()
flag=60
while True:
time.sleep(5)
page=s.page(flag)
info=s.find_info(page)
for i in info:
mp4_dict=s.find_mp4(i[0],reqget)
tittle=i[1].strip()
print(tittle)
if os.path.exists(str(tittle)+'.mp4')==False:
print(s.sources_mp4(mp4_dict,reqget))
download(s.sources_mp4(mp4_dict,reqget),tittle)
else:
#continue
time.sleep(time_sleep)
flag+=1
time.sleep(5)
|
|