From 653e57ad0d7eefb25b49da87a10da895e29d46df Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Fri, 7 Nov 2025 16:11:45 +0800 Subject: [PATCH 1/3] docs: Enhance deployment instructions Added instructions for updating AppleMusicDecrypt. --- android-deploy.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/android-deploy.md b/android-deploy.md index 9d5c904..00bb7e3 100644 --- a/android-deploy.md +++ b/android-deploy.md @@ -11,7 +11,7 @@ pd i debian ## Step 2: Deploy AppleMusicDecrypt Enter the Debian environment(`pd login debian`) ```shell -apt update && apt install pipx && pipx install poetry && pipx ensurepath && source ~/.bashrc +apt update && apt install pipx git -y && pipx install poetry && pipx ensurepath && source ~/.bashrc git clone https://github.com/WorldObservationLog/AppleMusicDecrypt cd AppleMusicDecrypt bash ./tools/install-deps.sh @@ -34,3 +34,12 @@ playlistDirPathFormat = "/sdcard/Music/playlists/{playlistName}" ``` ## Step 4: Run AppleMusicDecrypt `poetry run python main.py` +## Update AppleMusicDecrypt +```shell +pd login debian +cd AppleMusicDecrypt +git checkout -f && git pull +poetry update +cp config.example.toml config.toml +nano config.toml +``` From 2f754f9b4d6e8f81eb4d09d62e811911c273bbc2 Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Mon, 10 Nov 2025 01:09:58 +0800 Subject: [PATCH 2/3] Change exception to return empty string for lyrics Return an empty string instead of raising an exception for unsynced lyrics. --- src/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils.py b/src/utils.py index 45f5818..ea6efe9 100644 --- a/src/utils.py +++ b/src/utils.py @@ -96,7 +96,8 @@ def ttml_convent_to_lrc(ttml: str) -> str: h, m, s, ms = 0, 0, 0, 0 lyric_time: str = lyric.get("begin") if not lyric_time: - raise NotTimeSyncedLyricsException + return "" + #raise NotTimeSyncedLyricsException if lyric_time.find('.') == -1: lyric_time += '.000' match lyric_time.count(":"): From ea201f68f31c10549be7ab0b1ab360a0cff7cba0 Mon Sep 17 00:00:00 2001 From: itouakirai <85016486+itouakirai@users.noreply.github.com> Date: Mon, 10 Nov 2025 01:18:19 +0800 Subject: [PATCH 3/3] Refactor lyrics saving to use write_text method --- src/save.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/save.py b/src/save.py index 0558244..83aa08b 100644 --- a/src/save.py +++ b/src/save.py @@ -21,7 +21,8 @@ def save(song: bytes, codec: str, metadata: SongMetadata, playlist: PlaylistInfo with open(cover_path.absolute(), "wb") as f: f.write(metadata.cover) if it(Config).download.saveLyrics and metadata.lyrics: - lrc_path = dir_path / Path(song_name + ".lrc") - with open(lrc_path.absolute(), "w", encoding="utf-8") as f: - f.write(ttml_convent_to_lrc(metadata.lyrics)) + lrc = ttml_convent_to_lrc(metadata.lyrics) + if lrc: + lrc_path = dir_path / Path(song_name + ".lrc") + lrc_path.write_text(lrc, encoding="utf-8") return song_path.absolute()