Skip to content

Commit

Permalink
Add file exist flag for api.download()
Browse files Browse the repository at this point in the history
  • Loading branch information
upbit committed Nov 10, 2019
1 parent 35e37f7 commit 16eacc1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pixivpy3/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ def download(self, url, prefix='', path=os.path.curdir, name=None, replace=False
with open(img_path, 'wb') as out_file:
shutil.copyfileobj(response.raw, out_file)
del response
return True
else:
return False

0 comments on commit 16eacc1

Please sign in to comment.