diff --git a/android-deploy.md b/android-deploy.md index 00bb7e3..b99dc90 100644 --- a/android-deploy.md +++ b/android-deploy.md @@ -15,7 +15,7 @@ apt update && apt install pipx git -y && pipx install poetry && pipx ensurepath git clone https://github.com/WorldObservationLog/AppleMusicDecrypt cd AppleMusicDecrypt bash ./tools/install-deps.sh -poetry install +poetry env use /usr/bin/python3 && poetry install cp config.example.toml config.toml nano config.toml ``` diff --git a/src/utils.py b/src/utils.py index 2b8b856..00ca7a8 100644 --- a/src/utils.py +++ b/src/utils.py @@ -124,8 +124,11 @@ def ttml_convent(ttml: str) -> str: lrc_lines.append( f"[{str(m + h * 60).rjust(2, '0')}:{str(s).rjust(2, '0')}.{str(int(ms / 10)).rjust(2, '0')}]{lyric.text}") if "translation" in it(Config).download.lyricsExtra and b.tt.head.metadata.iTunesMetadata.translation: + trans_type = b.tt.head.metadata.iTunesMetadata.translation.get("type") for translation in b.tt.head.metadata.iTunesMetadata.translation.children: if lyric.get("itunes:key") == translation.get("for"): + if trans_type == "replacement": + del lrc_lines[-1] lrc_lines.append( f"[{str(m + h * 60).rjust(2, '0')}:{str(s).rjust(2, '0')}.{str(int(ms / 10)).rjust(2, '0')}]{translation.text}") if "pronunciation" in it(Config).download.lyricsExtra and b.tt.head.metadata.iTunesMetadata.transliteration: