Removing special characters from artist while creating url

This commit is contained in:
matthias@arch 2021-09-29 16:17:22 +02:00
parent d6e690e192
commit a2a54abf60

View File

@ -102,6 +102,7 @@ class Nicole:
# remove spaces, from the title # remove spaces, from the title
for c in [' ', '-', ',', '.', '\'', '"', '°', '`', '´', '/', '!', '?', '#', '*']: for c in [' ', '-', ',', '.', '\'', '"', '°', '`', '´', '/', '!', '?', '#', '*']:
title = title.replace(c, '') title = title.replace(c, '')
artist = artist.replace(c, '')
# replace some stuff # replace some stuff
old = ['ä', 'ö', 'ü', '&'] old = ['ä', 'ö', 'ü', '&']
@ -109,6 +110,7 @@ class Nicole:
for i in range(len(old)): for i in range(len(old)):
title = title.replace(old[i], new[i]) title = title.replace(old[i], new[i])
artist = artist.replace(old[i], new[i])
return "https://azlyrics.com/lyrics/" + artist + '/' + title + ".html" return "https://azlyrics.com/lyrics/" + artist + '/' + title + ".html"