From f8ae3034171ca4191884805b5f97e45679f1ea05 Mon Sep 17 00:00:00 2001 From: MBucari Date: Fri, 9 May 2025 21:07:01 -0600 Subject: [PATCH] Fix download error (#1252 ) --- Source/AaxDecrypter/IDownloadOptions.cs | 4 ++-- Source/FileLiberator/DownloadOptions.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/AaxDecrypter/IDownloadOptions.cs b/Source/AaxDecrypter/IDownloadOptions.cs index be630e85..fb22350e 100644 --- a/Source/AaxDecrypter/IDownloadOptions.cs +++ b/Source/AaxDecrypter/IDownloadOptions.cs @@ -19,9 +19,9 @@ namespace AaxDecrypter public KeyData(string keyPart1, string? keyPart2 = null) { ArgumentNullException.ThrowIfNull(keyPart1, nameof(keyPart1)); - KeyPart1 = Convert.FromBase64String(keyPart1); + KeyPart1 = Convert.FromHexString(keyPart1); if (keyPart2 != null) - KeyPart2 = Convert.FromBase64String(keyPart2); + KeyPart2 = Convert.FromHexString(keyPart2); } } diff --git a/Source/FileLiberator/DownloadOptions.cs b/Source/FileLiberator/DownloadOptions.cs index 3f55abe2..86777021 100644 --- a/Source/FileLiberator/DownloadOptions.cs +++ b/Source/FileLiberator/DownloadOptions.cs @@ -108,8 +108,8 @@ namespace FileLiberator ContentMetadata = licInfo.ContentMetadata; InputType = licInfo.DrmType is AudibleApi.Common.DrmType.Widevine ? AAXClean.FileType.Dash - : licInfo.DrmType is AudibleApi.Common.DrmType.Adrm && licInfo.DecryptionKeys?.Length == 1 && licInfo.DecryptionKeys[0].KeyPart1.Length == 8 && licInfo.DecryptionKeys[0].KeyPart2 is null ? AAXClean.FileType.Aax - : licInfo.DrmType is AudibleApi.Common.DrmType.Adrm && licInfo.DecryptionKeys?.Length == 1 && licInfo.DecryptionKeys[0].KeyPart1.Length == 32 && licInfo.DecryptionKeys[0].KeyPart2?.Length == 32 ? AAXClean.FileType.Aaxc + : licInfo.DrmType is AudibleApi.Common.DrmType.Adrm && licInfo.DecryptionKeys?.Length == 1 && licInfo.DecryptionKeys[0].KeyPart1.Length == 4 && licInfo.DecryptionKeys[0].KeyPart2 is null ? AAXClean.FileType.Aax + : licInfo.DrmType is AudibleApi.Common.DrmType.Adrm && licInfo.DecryptionKeys?.Length == 1 && licInfo.DecryptionKeys[0].KeyPart1.Length == 16 && licInfo.DecryptionKeys[0].KeyPart2?.Length == 16 ? AAXClean.FileType.Aaxc : null; //If DrmType is not Adrm or Widevine, the delivered file is an unencrypted mp3.