Skip to content

Commit

Permalink
fix crash on downloading removed novels
Browse files Browse the repository at this point in the history
  • Loading branch information
safirex committed Apr 9, 2023
1 parent 0d58996 commit acabc9d
Showing 1 changed file with 26 additions and 23 deletions.
49 changes: 26 additions & 23 deletions src/main_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,31 +145,34 @@ def download(keep_text_format=False):
print(match[0][:25]+'... \t folder already exists')
continue

dir=''
if (name==''):
name=novel.getNovelTitle()

name=checkFileName(name)
print(name)
dir='./novel_list/'+code+' '+name
dir = checkFilePathLength(dir)

if code+' '+name not in match:
try :
os.mkdir('%s'%dir)
except FileExistsError:
print("the folder already exists")
try:
dir=''
if (name==''):
name=novel.getNovelTitle()

name=checkFileName(name)
print(name)
dir='./novel_list/'+code+' '+name
dir = checkFilePathLength(dir)

if code+' '+name not in match:
try :
os.mkdir('%s'%dir)
except FileExistsError:
print("the folder already exists")
continue
else:
print(code+' '+name+' folder already imported, update to fetch updates')
continue
else:
print(code+' '+name+' folder already imported, update to fetch updates')
continue

print("dir= "+dir)

#dir='./novel_list/'+code+' '+name
novel.setDir(dir)
novel.setLastChapter(0)
novel.processNovel()
print("dir= "+dir)

#dir='./novel_list/'+code+' '+name
novel.setDir(dir)
novel.setLastChapter(0)
novel.processNovel()
except Exception as err:
print("novel ",code," hasn't been downloaded because ",err)


def download_cli(userInput:str):
Expand Down

0 comments on commit acabc9d

Please sign in to comment.