Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
link = url
# In this case choice will be 0
choice = 0
else:
if is_quiet:
prepend.PREPEND(1)
print('Quiet is enabled')
prepend.PREPEND(1)
print('Searching Youtube for ', end='')
print(Fore.LIGHTYELLOW_EX, end='')
print(song_name, end='')
print(Style.RESET_ALL)
data, urls = yt.search(song_name, args.better_search,
kw=[args.artist, args.album])
# Handle the exception if urls has len 0
if len(urls) == 0:
prepend.PREPEND(2)
print("No song found. Please try again with a different keyword.")
print(Style.RESET_ALL, end='')
exit()
if len(data) > 1 and not is_quiet:
# Ask for a choice
choice = song.getChoice(data, 'mp3')
else:
choice = 0
link = 'https://youtube.com{}'.format(urls[int(choice)])