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 urllib.request
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import time
|
||||||
|
|
||||||
def generate_songname(tags):
|
def generate_songname(tags):
|
||||||
"""Generate a string of the format '[artist] - [song]' for the given spotify song."""
|
"""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:
|
with open(text_file, 'a') as myfile:
|
||||||
myfile.write(raw_song + '\n')
|
myfile.write(raw_song + '\n')
|
||||||
print('Failed to download song. Will retry after other songs.')
|
print('Failed to download song. Will retry after other songs.')
|
||||||
|
# wait 0.5 sec to avoid infinite looping
|
||||||
|
time.sleep(0.5)
|
||||||
continue
|
continue
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
misc.grace_quit()
|
misc.grace_quit()
|
||||||
|
|||||||
Reference in New Issue
Block a user