summaryrefslogtreecommitdiff
path: root/jamos
diff options
context:
space:
mode:
Diffstat (limited to 'jamos')
-rwxr-xr-xjamos12
1 files changed, 10 insertions, 2 deletions
diff --git a/jamos b/jamos
index 0783e70..c068b5c 100755
--- a/jamos
+++ b/jamos
@@ -208,9 +208,9 @@ def create_downloader(music_directory, cookies):
def save_urls_from_playlist_to_file(filename, urls):
try:
- f = open(filename, "w")
+ f = open(filename, "a")
for url in urls:
- f.writelines(url)
+ f.writelines(url + '\n')
f.close()
except Exception as e:
print(e)
@@ -262,6 +262,14 @@ if __name__ == "__main__":
save_urls_from_playlist_to_file(
os.path.join(music_directory, "jamos_failed_urls.txt"),
failed_urls)
+ elif args.retryFile:
+ # Just because we don't have any failed urls in this run, doesn't
+ # mean that we can get rid of the retry file. We'll only remove it
+ # if it's been explicitly tried and we have no failed urls.
+
+ # We've successfully downloaded all of the previously failed urls.
+ # Delete the file
+ os.remove(args.retryFile)
except Exception as ex:
print(ex)
print("Saving failed urls to file failed! Printing failed urls:")