mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-12-08 20:39:08 +00:00
optimize code
This commit is contained in:
@@ -43,13 +43,12 @@ def searchYT(number):
|
|||||||
print((str(check) + '. ' + x.get_text()).encode('utf-8'))
|
print((str(check) + '. ' + x.get_text()).encode('utf-8'))
|
||||||
links.append(x.find('a')['href'])
|
links.append(x.find('a')['href'])
|
||||||
check += 1
|
check += 1
|
||||||
is_error = True
|
|
||||||
print('')
|
print('')
|
||||||
while is_error:
|
while True:
|
||||||
try:
|
try:
|
||||||
the_chosen_one = int(raw_input('>> Choose your number: '))
|
the_chosen_one = int(raw_input('>> Choose your number: '))
|
||||||
if the_chosen_one >= 1 and the_chosen_one <= len(links):
|
if the_chosen_one >= 1 and the_chosen_one <= len(links):
|
||||||
is_error = False
|
break
|
||||||
else:
|
else:
|
||||||
print('Choose a valid number!')
|
print('Choose a valid number!')
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
|||||||
Reference in New Issue
Block a user