From bef24eef7fc94e1cf59db12d6286846db2310af5 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Fri, 5 Oct 2018 00:00:23 +0200 Subject: [PATCH] Place newline before track URL when appending to track file --- spotdl/spotdl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spotdl/spotdl.py b/spotdl/spotdl.py index 3cee64f..f381798 100755 --- a/spotdl/spotdl.py +++ b/spotdl/spotdl.py @@ -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)