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 +``` 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() 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(":"):