Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Quentin Aristote
Soundscapes
Commits
b6abc6d8
Commit
b6abc6d8
authored
Nov 29, 2019
by
Quentin Aristote
Browse files
handle download failure
parent
2b703b16
Changes
1
Hide whitespace changes
Inline
Side-by-side
recordings/get_recordings.py
View file @
b6abc6d8
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment