sped up loop to fix lyrics occasionly missing

This commit is contained in:
Brandon4466
2023-01-11 17:55:05 -08:00
parent f53ec36b69
commit 98bd4ff9b9
2 changed files with 4 additions and 3 deletions

View File

@@ -305,12 +305,13 @@ def update_song_label():
track_progress_label.config(text=track_progress_formatted)
progress_bar.config(maximum=track_duration)
progress_bar.config(value=track_progress)
print(track_progress_formatted)
for line in str(lrc).splitlines():
if track_progress_formatted in line:
lyric = line.split("]")[1]
wrapped_lyric = textwrap.fill(lyric, 21)
lyrics_label.config(text=wrapped_lyric)
root.after(1000, update_song_label)
root.after(850, update_song_label)
else:
# album_art_data = Image.open(requests.get(album_art_url, stream=True).raw)
# album_art_data.save("album_art.jpg")
@@ -321,7 +322,7 @@ def update_song_label():
volumeslider_button.set(value=current_volume)
lyrics_label.config(text="")
lrc = syncedlyrics.search("[" + track_name + "] [" + artist_name + "]")
root.after(1000, update_song_label)
root.after(500, update_song_label)
# if album_art_url == "12345":
# open_url = urlopen(album_art_url)
# raw_image_data = open_url.read()