Lyrics added
This commit is contained in:
parent
8b95e2ab8b
commit
00be7a6563
1 changed files with 2 additions and 9 deletions
|
@ -46,15 +46,8 @@ def musicstatus():
|
|||
if os.path.exists("lyrics/" + history[-1][0] + ".lrc"):
|
||||
with open("lyrics/" + history[-1][0] + ".lrc", "r") as f:
|
||||
lyrics = f.read().split("\n")
|
||||
for i in range(len(lyrics)):
|
||||
if lyrics[i] == "":
|
||||
lyrics.pop(i)
|
||||
for i in range(len(lyrics)):
|
||||
if lyrics[i].startswith("["):
|
||||
if ":" in lyrics[i].split("]")[0]:
|
||||
lyrics.pop(i)
|
||||
else:
|
||||
lyrics[i] = lyrics[i][10:]
|
||||
lyrics = [lyric.split("]")[1] for lyric in lyrics if "]" in lyric]
|
||||
lyrics = [lyric for lyric in lyrics if not lyric == ""]
|
||||
html += '<h3>Lyrics:</h3>\n'
|
||||
html += '<div style="border: 1px solid #ffffff; padding: 10px; text-align: center;">\n'
|
||||
for lyric in lyrics:
|
||||
|
|
Loading…
Reference in a new issue