Try to not overwrite existing files
This commit is contained in:
parent
b3ca71d477
commit
70caca9ca0
@ -51,6 +51,7 @@ func (p *Pixiv) downloadIllust(i Illust) (err error) {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err = os.Stat(file.directory + file.filename); os.IsNotExist(err) {
|
||||
outfile, err := os.Create(file.directory + file.filename)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -67,6 +68,10 @@ func (p *Pixiv) downloadIllust(i Illust) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
err = nil
|
||||
continue
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user