mirror of
https://github.com/zhaarey/AppleMusicDecrypt.git
synced 2025-10-23 15:11:06 +00:00
feat: support song_id and album_id format
This commit is contained in:
@@ -60,6 +60,7 @@ audioInfoFormat = ""
|
||||
# title, artist, album, album_artist, composer,
|
||||
# genre, created, track, tracknum, disk,
|
||||
# record_company, upc, isrc, copyright, codec, audio_info
|
||||
# song_id, album_id
|
||||
songNameFormat = "{disk}-{tracknum:02d} {title}"
|
||||
# Ditto
|
||||
dirPathFormat = "downloads/{album_artist}/{album}"
|
||||
@@ -68,12 +69,14 @@ dirPathFormat = "downloads/{album_artist}/{album}"
|
||||
# genre, created, track, tracknum, disk,
|
||||
# record_company, upc, isrc, copyright,
|
||||
# playlistName, playlistCuratorName, codec
|
||||
# song_id, album_id
|
||||
playlistDirPathFormat = "downloads/playlists/{playlistName}"
|
||||
# Available values:
|
||||
# title, artist, album, album_artist, composer,
|
||||
# genre, created, track, tracknum, disk,
|
||||
# record_company, upc, isrc, copyright, audio_info
|
||||
# playlistName, playlistCuratorName, playlistSongIndex, codec
|
||||
# song_id, album_id
|
||||
playlistSongNameFormat = "{playlistSongIndex:02d}. {artist} - {title}"
|
||||
# Save lyrics as .lrc file
|
||||
saveLyrics = true
|
||||
|
||||
@@ -6,12 +6,15 @@ from src.api import get_cover
|
||||
from src.models.song_data import Datum
|
||||
from src.utils import ttml_convent_to_lrc
|
||||
|
||||
NOT_INCLUDED_FIELD = ["cover", "playlistIndex", "bit_depth", "sample_rate", "sample_rate_kHz"]
|
||||
NOT_INCLUDED_FIELD = ["cover", "playlistIndex", "bit_depth", "sample_rate",
|
||||
"sample_rate_kHz", "song_id", "album_id"]
|
||||
|
||||
|
||||
class SongMetadata(BaseModel):
|
||||
song_id: Optional[str] = None
|
||||
title: Optional[str] = None
|
||||
artist: Optional[str] = None
|
||||
album_id: Optional[str] = None
|
||||
album_artist: Optional[str] = None
|
||||
album: Optional[str] = None
|
||||
composer: Optional[str] = None
|
||||
@@ -65,7 +68,8 @@ class SongMetadata(BaseModel):
|
||||
record_company=song_data.relationships.albums.data[0].attributes.recordLabel,
|
||||
upc=song_data.relationships.albums.data[0].attributes.upc,
|
||||
isrc=song_data.attributes.isrc,
|
||||
rtng=1 if song_data.attributes.contentRating and song_data.attributes.contentRating == 'explicit' else 0
|
||||
rtng=1 if song_data.attributes.contentRating and song_data.attributes.contentRating == 'explicit' else 0,
|
||||
song_id=song_data.id, album_id=song_data.relationships.albums.data[0].id
|
||||
)
|
||||
|
||||
def set_lyrics(self, lyrics: str):
|
||||
|
||||
Reference in New Issue
Block a user