Place newline before track URL when appending to track file

This commit is contained in:
Linus Groh
2018-10-05 00:00:23 +02:00
parent 3a52fe4de5
commit bef24eef7f

View File

@@ -105,7 +105,7 @@ def download_list(tracks_file, skip_file=None, write_successful_file=None):
internals.trim_song(tracks_file)
# and append it at the end of file
with open(tracks_file, 'a') as f:
f.write(raw_song + '\n')
f.write('\n' + raw_song)
log.warning('Failed to download song. Will retry after other songs\n')
# wait 0.5 sec to avoid infinite looping
time.sleep(0.5)
@@ -116,7 +116,7 @@ def download_list(tracks_file, skip_file=None, write_successful_file=None):
log.debug('Adding downloaded song to write successful file')
if write_successful_file is not None:
with open(write_successful_file, 'a') as f:
f.write(raw_song + '\n')
f.write('\n' + raw_song)
log.debug('Removing downloaded song from tracks file')
internals.trim_song(tracks_file)