Handle wrapper: skip exec checks and adjust codec

This commit is contained in:
Rafael Moraes
2026-02-23 23:18:28 -03:00
parent 9aa7a2e199
commit 23a5be37b1
2 changed files with 42 additions and 34 deletions
+28 -18
View File
@@ -104,6 +104,13 @@ async def main(config: CliConfig):
" downloadable"
)
if config.song_codec.is_legacy() and config.use_wrapper:
logger.warning(
"Legacy song codecs are not supported when using the wrapper."
"Your song codec will be changed to AAC."
)
config.song_codec = SongCodec.AAC
interface = AppleMusicInterface(
apple_music_api,
itunes_api,
@@ -171,26 +178,29 @@ async def main(config: CliConfig):
)
if not config.synced_lyrics_only:
if not base_downloader.full_ffmpeg_path and (
config.remux_mode == RemuxMode.FFMPEG
or config.download_mode == DownloadMode.NM3U8DLRE
):
logger.critical(X_NOT_IN_PATH.format("ffmpeg", config.ffmpeg_path))
return
if not config.use_wrapper:
if not base_downloader.full_ffmpeg_path and (
config.remux_mode == RemuxMode.FFMPEG
or config.download_mode == DownloadMode.NM3U8DLRE
):
logger.critical(X_NOT_IN_PATH.format("ffmpeg", config.ffmpeg_path))
return
if (
not base_downloader.full_mp4box_path
and config.remux_mode == RemuxMode.MP4BOX
):
logger.critical(X_NOT_IN_PATH.format("MP4Box", config.mp4box_path))
return
if (
not base_downloader.full_mp4box_path
and config.remux_mode == RemuxMode.MP4BOX
):
logger.critical(X_NOT_IN_PATH.format("MP4Box", config.mp4box_path))
return
if not base_downloader.full_mp4decrypt_path and (
config.song_codec not in (SongCodec.AAC_LEGACY, SongCodec.AAC_HE_LEGACY)
or config.remux_mode == RemuxMode.MP4BOX
):
logger.critical(X_NOT_IN_PATH.format("mp4decrypt", config.mp4decrypt_path))
return
if not base_downloader.full_mp4decrypt_path and (
config.song_codec not in (SongCodec.AAC_LEGACY, SongCodec.AAC_HE_LEGACY)
or config.remux_mode == RemuxMode.MP4BOX
):
logger.critical(
X_NOT_IN_PATH.format("mp4decrypt", config.mp4decrypt_path)
)
return
if (
config.download_mode == DownloadMode.NM3U8DLRE
+14 -16
View File
@@ -480,26 +480,24 @@ class AppleMusicDownloader:
*SONG_MEDIA_TYPE,
*MUSIC_VIDEO_MEDIA_TYPE,
}:
if (
self.base_downloader.remux_mode == RemuxMode.FFMPEG
and not self.base_downloader.full_ffmpeg_path
):
raise ExecutableNotFound("ffmpeg")
if not self.base_downloader.use_wrapper:
if (
self.base_downloader.remux_mode == RemuxMode.FFMPEG
and not self.base_downloader.full_ffmpeg_path
):
raise ExecutableNotFound("ffmpeg")
if (
self.base_downloader.remux_mode == RemuxMode.MP4BOX
and not self.base_downloader.full_mp4box_path
):
raise ExecutableNotFound("MP4Box")
if (
self.base_downloader.remux_mode == RemuxMode.MP4BOX
and not self.base_downloader.full_mp4box_path
):
raise ExecutableNotFound("MP4Box")
if (
self.song_downloader.use_wrapper
or (
if (
download_item.media_metadata["type"] in MUSIC_VIDEO_MEDIA_TYPE
or self.base_downloader.remux_mode == RemuxMode.MP4BOX
)
) and not self.base_downloader.full_mp4decrypt_path:
raise ExecutableNotFound("mp4decrypt")
) and not self.base_downloader.full_mp4decrypt_path:
raise ExecutableNotFound("mp4decrypt")
if (
self.base_downloader.download_mode == DownloadMode.NM3U8DLRE