如果要从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)
|