From 633fb9b1bd5a448df84615b77495bbcb44a7c6d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20G=C3=A9rard?= Date: Wed, 30 Aug 2017 16:31:23 +0200 Subject: [PATCH] [fix] add wait to avoid infinite retry looping (#126) --- spotdl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spotdl.py b/spotdl.py index 5092871..f1d9712 100755 --- a/spotdl.py +++ b/spotdl.py @@ -12,6 +12,7 @@ import pafy import urllib.request import sys import os +import time def generate_songname(tags): """Generate a string of the format '[artist] - [song]' for the given spotify song.""" @@ -297,6 +298,8 @@ def grab_list(text_file): with open(text_file, 'a') as myfile: myfile.write(raw_song + '\n') print('Failed to download song. Will retry after other songs.') + # wait 0.5 sec to avoid infinite looping + time.sleep(0.5) continue except KeyboardInterrupt: misc.grace_quit()