Skip to content

Commit

Permalink
Remove double slash (#894)
Browse files Browse the repository at this point in the history
To prevent images saved on root dir of directory. see comments #891
  • Loading branch information
YukihoAA authored Jan 15, 2021
1 parent fc359db commit ece620a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PixivHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ def make_filename(nameFormat: str,
# clean up double space
while nameFormat.find(' ') > -1:
nameFormat = nameFormat.replace(' ', ' ')

# clean up double slash
while nameFormat.find('//') > -1 or nameFormat.find('\\\\') > -1:
nameFormat = nameFormat.replace('//', '/').replace('\\\\', '\\')

if appendExtension:
nameFormat = nameFormat.strip() + '.' + imageExtension
Expand Down

0 comments on commit ece620a

Please sign in to comment.