Commit b6abc6d8 authored by Quentin Aristote's avatar Quentin Aristote
Browse files

handle download failure

parent 2b703b16
......@@ -182,14 +182,16 @@ def getRecordings(directory = '.',
for id in getFilesIDs(html) :
filename = id + '.mp3'
path = os.path.join(directory, filename)
print('Downloading {filename} ...'.format(filename = filename))
if not(os.path.isfile(path)) or overwrite :
file_html = getFileHTML(id)
print('Downloading {filename} ...'.format(filename = filename))
try :
_ = downloadFile(file_html, path = path)
print('Success.')
except Exception as e :
print('Failure : {exception}'.format(exception = e))
else :
print('File already downloaded.')
return None
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment