mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
[fix] add wait to avoid infinite retry looping (#126)
This commit is contained in:
committed by
Ritiek Malhotra
parent
c73c650383
commit
633fb9b1bd
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user