本文主要用于非商业性需求下载,鉴于很多人都不知道去哪看一拳超人原作版漫画,本人出于人道主义上传此文章,希望各位看官能够遵守相应的商业规则及法律法规本文系原创,禁止转载图片来源:突袭网话说打破热血动漫常用套路的神作,莫过于我们的光头漫画,真正实现开局999级,见人就砍,主宰整个世界的传奇,然而这部神作其实有两个版本,一个是翻拍成动画的村田版,另一个才是真正的原作——one版,原作者就是底下这位one老贼图片来源:搜狐咳咳,不对,是one老师!而这部作品就跟主角一样,诞生的太过于随意,所以画风长这样还有这样简直可以用毫无人性来描述了好么,更残忍的事实是:一拳超人是ONE老师的随手练笔之作,而灵能才是ONE老师的认真画作。不过如此随意的漫画一点都不让人失望的好吗!作为资深拳迷,向one老师致敬,因为你实现了万千屌丝日夜幻想的逆袭梦,所以我用python将原作漫画全部下载都我电脑上了,特此将者福利送给在座的各位,(不过我希望你们能够不要去改动源码,因为加了多线程,在速度上已经最快了,所以我特意放慢了爬的速度,为了防止网站被弄崩溃,随意希望大家能够让后来者也能用上,不然又要搞反扒,很累人的好伐!)import requestsimport timeimport impimport reimport sysimp.reload(sys)import osimport multiprocessingclass One_Punch_Man_Spider(object): “””初始化地址和请求头””” def __init__(self): self.headers = {‘User-Agent':’Mozilla/5.0 (Windows NT 10.0; Wi\ n64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.\ 0.3729.108 Safari/537.36′} self.s = requests.Session() self.url = “https://www.cartoonmad.com/comic/5035.html” “””拉需求””” def request_pull(self,url): try: response = self.s.get(url,headers=self.headers,timeout=5) return response except Exception as e: print(e) “””图片下载””” def picture_download(self,charpter_maxpages): try: for charpter_maxpage in charpter_maxpages: self.filebox_create(charpter_maxpage[0]) for page in range(1,int(charpter_maxpage[1])+1): url_base = “http://web.cartoonmad.com/home75488/5035/” url = f”{url_base}{charpter_maxpage[0]}/{page:0>3}.jpg” headers = {‘User-Agent':’Mozilla/5.0 (Windows NT 10.0; Wi\ n64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.\ 0.3729.108 Safari/537.36′} print(url) time.sleep(3) response = self.s.get(url,headers = headers) if response: with open(f’E:\一拳超人漫画\{charpter_maxpage[0]}\第{page}页.png’,”wb”) as f: f.write(response.content) else: print(“没有响应”) sys.exit() except FileExistsError as e: print(e) “””文件夹创建””” def filebox_create(self,charpter): try: os.makedirs(f”E:\一拳超人漫画\{charpter}”) except FileExistsError: pass “””章节和最大页解析””” def charpter_maxpage_url_parse(self): response = self.request_pull(self.url) if response: response.encoding =”big5″ pattern_charpter_maxpage = re.compile(r”””( <a\s+href=\W{1}\w+\W{1}\d+\.\w+\s+.*?>[\u4e00-\u9fa5]+\s+(\d+)\s+[\u4e00-\u9fa5]+</a>.*?font.*?\((\d+)[\u4e00-\u9fa5]+\) )”””,re.VERBOSE|re.S) items = re.findall(pattern_charpter_maxpage,response.text) items_list_all = [item[1:] for item in items] num_divide = len(items_list_all)//3 items_new_0 = [items_list_all.pop(0) for i in range(0,num_divide+1)] items_new_1 = [items_list_all.pop(0) for i in range(0,num_divide+1)] return [items_new_0,items_new_1,items_list_all] else: passif __name__==”__main__”: one_punch_man_cartoon_downloader = One_Punch_Man_Spider() charpter_maxpages = one_punch_man_cartoon_downloader.charpter_maxpage_url_parse() # for i in charpter_maxpages: # for h in i: # print(i) p = multiprocessing.Pool(3) p.map(one_punch_man_cartoon_downloader.picture_download,charpter_maxpages) 喜欢我就关注我,谢谢!
本文出自快速备案,转载时请注明出处及相应链接。