mirror of
https://github.com/glomatico/gamdl.git
synced 2026-06-13 04:05:14 +03:00
Add Python amdecrypt and remove amdecrypt dep
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -496,12 +496,6 @@ class AppleMusicDownloader:
|
||||
) and not self.base_downloader.full_mp4decrypt_path:
|
||||
raise ExecutableNotFound("mp4decrypt")
|
||||
|
||||
if (
|
||||
self.song_downloader.use_wrapper
|
||||
and not self.base_downloader.full_amdecrypt_path
|
||||
):
|
||||
raise ExecutableNotFound("amdecrypt")
|
||||
|
||||
if (
|
||||
self.base_downloader.download_mode == DownloadMode.NM3U8DLRE
|
||||
and not self.base_downloader.full_nm3u8dlre_path
|
||||
|
||||
@@ -29,7 +29,6 @@ class AppleMusicBaseDownloader:
|
||||
mp4decrypt_path: str = "mp4decrypt",
|
||||
ffmpeg_path: str = "ffmpeg",
|
||||
mp4box_path: str = "MP4Box",
|
||||
amdecrypt_path: str = "amdecrypt",
|
||||
use_wrapper: bool = False,
|
||||
wrapper_decrypt_ip: str = "127.0.0.1:10020",
|
||||
download_mode: DownloadMode = DownloadMode.YTDLP,
|
||||
@@ -58,7 +57,6 @@ class AppleMusicBaseDownloader:
|
||||
self.mp4decrypt_path = mp4decrypt_path
|
||||
self.ffmpeg_path = ffmpeg_path
|
||||
self.mp4box_path = mp4box_path
|
||||
self.amdecrypt_path = amdecrypt_path
|
||||
self.use_wrapper = use_wrapper
|
||||
self.wrapper_decrypt_ip = wrapper_decrypt_ip
|
||||
self.download_mode = download_mode
|
||||
@@ -87,7 +85,6 @@ class AppleMusicBaseDownloader:
|
||||
self.full_mp4decrypt_path = shutil.which(self.mp4decrypt_path)
|
||||
self.full_ffmpeg_path = shutil.which(self.ffmpeg_path)
|
||||
self.full_mp4box_path = shutil.which(self.mp4box_path)
|
||||
self.full_amdecrypt_path = shutil.which(self.amdecrypt_path)
|
||||
|
||||
def _initialize_cdm(self):
|
||||
if self.wvd_path:
|
||||
|
||||
@@ -4,6 +4,7 @@ from ..interface.enums import SongCodec, SyncedLyricsFormat
|
||||
from ..interface.interface_song import AppleMusicSongInterface
|
||||
from ..interface.types import DecryptionKeyAv
|
||||
from ..utils import async_subprocess
|
||||
from .amdecrypt import decrypt_file
|
||||
from .constants import DEFAULT_SONG_DECRYPTION_KEY
|
||||
from .downloader_base import AppleMusicBaseDownloader
|
||||
from .enums import RemuxMode
|
||||
@@ -235,10 +236,8 @@ class AppleMusicSongDownloader(AppleMusicBaseDownloader):
|
||||
media_id: str,
|
||||
fairplay_key: str,
|
||||
) -> None:
|
||||
await async_subprocess(
|
||||
self.amdecrypt_path,
|
||||
await decrypt_file(
|
||||
self.wrapper_decrypt_ip,
|
||||
self.full_mp4decrypt_path,
|
||||
media_id,
|
||||
fairplay_key,
|
||||
input_path,
|
||||
|
||||
Reference in New Issue
Block a user