This commit is contained in:
parent
594f59529b
commit
d350e48bd5
5
books.py
5
books.py
@ -1,6 +1,6 @@
|
||||
from asyncio import gather, get_event_loop, run
|
||||
from functools import partial, wraps
|
||||
from os import makedirs
|
||||
from os import makedirs, path
|
||||
from typing import List
|
||||
|
||||
from PIL import Image
|
||||
@ -58,6 +58,9 @@ class MyChapter(Chapter):
|
||||
for img in self.etree.xpath(".//img"):
|
||||
if img.attrib["src"].startswith("http"):
|
||||
img.getparent().remove(img)
|
||||
else:
|
||||
image = Image.open(f"{path.dirname(image_dir)}/{img.attrib['src']}")
|
||||
image.thumbnail((1000, 2000))
|
||||
|
||||
|
||||
def async_wrap(func):
|
||||
|
Reference in New Issue
Block a user