斗破苍穹
def download_img(image_url, cartoon_name, chapter, index):
import requests
try:
response = requests.get(image_url)
if response.status_code != 404:
with open("zymk/" + cartoon_name + "/" + str(chapter) + "/" + str(index) + ".jpg", 'wb') as f:
f.write(response.content)
return True
else:
return False
except Exception as e:
print("download_img"

本文介绍了一种使用Python编写的漫画下载器代码,该代码能够从特定网站抓取《斗破苍穹》和《斗罗大陆》的漫画章节图片,并将其保存到本地目录。通过修改章节列表和秘密代码,可以下载不同章节的漫画。代码利用requests库进行HTTP请求,检查响应状态码,然后将图片内容写入文件。
2528

被折叠的 条评论
为什么被折叠?



