mirror of
https://github.com/zhaarey/AppleMusicDecrypt.git
synced 2025-10-23 15:11:06 +00:00
fix: crash when missing metadata.created
This commit is contained in:
@@ -176,7 +176,10 @@ def write_metadata(song: bytes, metadata: SongMetadata, embed_metadata: list[str
|
||||
absolute_cover_path = cover_path.absolute()
|
||||
with open(cover_path.absolute(), "wb") as f:
|
||||
f.write(metadata.cover)
|
||||
time = datetime.strptime(metadata.created, "%Y-%m-%d").strftime("%d/%m/%Y")
|
||||
if metadata.created:
|
||||
time = datetime.strptime(metadata.created, "%Y-%m-%d").strftime("%d/%m/%Y")
|
||||
else:
|
||||
time = ""
|
||||
subprocess.run(["mp4box", "-time", time, "-mtime", time, "-keep-utc", "-name", f"1={metadata.title}", "-itags",
|
||||
":".join(["tool=", f"cover={absolute_cover_path}",
|
||||
metadata.to_itags_params(embed_metadata)]),
|
||||
|
||||
Reference in New Issue
Block a user