skip already existing files

This commit is contained in:
boyska 2017-03-09 23:52:33 +01:00
parent f333faeff8
commit 4a9d9f2373

View file

@ -22,6 +22,7 @@ def download_track(track, args):
os.makedirs(join(args.download_base, fdir), exist_ok=True)
if exists(fpath):
log.info('file %s exists, skipping' % fpath)
return
log.debug('download in ' + fpath)
resp = requests.get(track['url'], stream=True)
if not resp.ok: