def download_chapter_m(self):
'''
???????????
Download all pages of the chapter using multiprocessing
'''
results=[]
if not self.pages:
print('No page')
return None
mp=Pool(min(8,max(cpu_count(),4)))
for page in self.pages:
results.append(mp.apply_async(self.download_page,(page,)))
mp.close()
mp.join()
num=sum([result.get() for result in results])
print('Downloaded {} pages'.format(num))
评论列表
文章目录