Skip to content

Commit

Permalink
Fix not downloading images error
Browse files Browse the repository at this point in the history
  • Loading branch information
fangxx3863 committed Jul 17, 2022
1 parent 903605f commit c2f8bc9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bilinovel2epub.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ def 主要():
except:
pass
else:
文件存在 = os.path.exists("file") #判断路径是否存在
if not 文件存在:
# 如果不存在则创建目录
os.makedirs("file")
下载文件(封面URL)
写到书本(书名, 作者, 内容, "cover", "file/" + "-".join(封面URL.split("/")[-4:]), "file")
try:
shutil.rmtree('file')
Expand Down Expand Up @@ -472,6 +477,11 @@ def 主要():
except:
pass
else:
文件存在 = os.path.exists("file") #判断路径是否存在
if not 文件存在:
# 如果不存在则创建目录
os.makedirs("file")
下载文件(封面URL)
写到书本(书名, 作者, 内容, "cover", "file/" + "-".join(封面URL.split("/")[-4:]), "file")
try:
shutil.rmtree('file')
Expand Down

0 comments on commit c2f8bc9

Please sign in to comment.