mirror of
https://github.com/WorldObservationLog/AppleMusicDecrypt.git
synced 2026-01-15 14:22:54 -03:00
Merge remote-tracking branch 'origin/v2' into v2
Some checks failed
/ Build Windows (push) Has been cancelled
Some checks failed
/ Build Windows (push) Has been cancelled
This commit is contained in:
@@ -11,7 +11,7 @@ pd i debian
|
|||||||
## Step 2: Deploy AppleMusicDecrypt
|
## Step 2: Deploy AppleMusicDecrypt
|
||||||
Enter the Debian environment(`pd login debian`)
|
Enter the Debian environment(`pd login debian`)
|
||||||
```shell
|
```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
|
git clone https://github.com/WorldObservationLog/AppleMusicDecrypt
|
||||||
cd AppleMusicDecrypt
|
cd AppleMusicDecrypt
|
||||||
bash ./tools/install-deps.sh
|
bash ./tools/install-deps.sh
|
||||||
@@ -34,3 +34,12 @@ playlistDirPathFormat = "/sdcard/Music/playlists/{playlistName}"
|
|||||||
```
|
```
|
||||||
## Step 4: Run AppleMusicDecrypt
|
## Step 4: Run AppleMusicDecrypt
|
||||||
`poetry run python main.py`
|
`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
|
||||||
|
```
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ def save(song: bytes, codec: str, metadata: SongMetadata, playlist: PlaylistInfo
|
|||||||
with open(cover_path.absolute(), "wb") as f:
|
with open(cover_path.absolute(), "wb") as f:
|
||||||
f.write(metadata.cover)
|
f.write(metadata.cover)
|
||||||
if it(Config).download.saveLyrics and metadata.lyrics:
|
if it(Config).download.saveLyrics and metadata.lyrics:
|
||||||
lrc_path = dir_path / Path(song_name + ".lrc")
|
lrc = ttml_convent_to_lrc(metadata.lyrics)
|
||||||
with open(lrc_path.absolute(), "w", encoding="utf-8") as f:
|
if lrc:
|
||||||
f.write(ttml_convent_to_lrc(metadata.lyrics))
|
lrc_path = dir_path / Path(song_name + ".lrc")
|
||||||
|
lrc_path.write_text(lrc, encoding="utf-8")
|
||||||
return song_path.absolute()
|
return song_path.absolute()
|
||||||
|
|||||||
@@ -96,7 +96,8 @@ def ttml_convent_to_lrc(ttml: str) -> str:
|
|||||||
h, m, s, ms = 0, 0, 0, 0
|
h, m, s, ms = 0, 0, 0, 0
|
||||||
lyric_time: str = lyric.get("begin")
|
lyric_time: str = lyric.get("begin")
|
||||||
if not lyric_time:
|
if not lyric_time:
|
||||||
raise NotTimeSyncedLyricsException
|
return ""
|
||||||
|
#raise NotTimeSyncedLyricsException
|
||||||
if lyric_time.find('.') == -1:
|
if lyric_time.find('.') == -1:
|
||||||
lyric_time += '.000'
|
lyric_time += '.000'
|
||||||
match lyric_time.count(":"):
|
match lyric_time.count(":"):
|
||||||
|
|||||||
Reference in New Issue
Block a user