Skip to content

Commit

Permalink
fix: 修复MP3内嵌歌词读取
Browse files Browse the repository at this point in the history
  • Loading branch information
helloplhm-qwq committed Feb 6, 2024
1 parent b9a1e53 commit d2bedcf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions common/localMusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,18 @@ def getAudioMeta(filepath):
cover = audio.get('APIC:')
if (cover):
cover = convertCover(cover.data)

lrc_key = None
for k in list(audio.keys()):
if (k.startswith('USLT')):
lrc_key = k
break
title = audio.get('TIT2')
artist = audio.get('TPE1')
album = audio.get('TALB')
lyric = audio.get('TLRC')
if (lrc_key):
lyric = audio.get(lrc_key)
else:
lyric = None
if (title):
title = title.text
if (artist):
Expand Down

0 comments on commit d2bedcf

Please sign in to comment.