WorldObservationLog / AppleMusicDecrypt

Apple Music decryption tool, based on zhaarey/apple-music-alac-atmos-downloader
GNU Affero General Public License v3.0
114 stars 30 forks source link

Decryption Failing #10

Closed Roxiun closed 6 months ago

Roxiun commented 6 months ago

Similar to issue #7

Platform M1 Macbook (arm64)

I can confirm all of the above work. However I am unable to run x86_64 version of android on this computer and as such am running the arm64 version of emulator & arm64 Apple Music beta.

Snipped Error Log:

2024-05-29 19:08:02.471 | WARNING  | src.decrypt:decrypt:51 - Failed to decrypt song: Fujii Kaze - Seishun Sick, retrying
2024-05-29 19:08:02.471 | Level 30 | tenacity.before_sleep:log_it:65 - Retrying src.utils.timeit.<locals>.helper in 0.0 seconds as it raised RetryableDecryptException: .
2024-05-29 19:08:02.471 | INFO     | src.decrypt:decrypt:25 - Using device 127.0.0.1:5555 to decrypt song: Fujii Kaze - Seishun Sick
2024-05-29 19:08:02.473 | WARNING  | src.decrypt:decrypt:51 - Failed to decrypt song: Fujii Kaze - Seishun Sick, retrying
2024-05-29 19:08:02.473 | Level 30 | tenacity.before_sleep:log_it:65 - Retrying src.utils.timeit.<locals>.helper in 0.0 seconds as it raised RetryableDecryptException: .
2024-05-29 19:08:02.474 | INFO     | src.decrypt:decrypt:25 - Using device 127.0.0.1:5555 to decrypt song: Fujii Kaze - Seishun Sick
2024-05-29 19:08:02.476 | WARNING  | src.decrypt:decrypt:51 - Failed to decrypt song: Fujii Kaze - Seishun Sick, retrying
2024-05-29 19:08:02.476 | ERROR    | __main__:<module>:16 - An error has been caught in function '<module>', process 'MainProcess' (13431), thread 'MainThread' (7991024704):
Traceback (most recent call last):

  File "/Users/user1/Library/Caches/pypoetry/virtualenvs/applemusicdecrypt-TlDC6A93-py3.12/lib/python3.12/site-packages/tenacity/_asyncio.py", line 61, in __call__
    result = await fn(*args, **kwargs)
                   │   │       └ {}
                   │   └ (SongInfo(codec='alac', raw=b'\x00\x00\x00$ftypiso5\x00\x00\x00\x01isomiso5hlsfcmfcccea\x00\x00\x03\xe9moov\x00\x00\x00lmvhd\...
                   └ <function timeit.<locals>.helper at 0x106cb9260>

  File "/Users/user1/Documents/Miscellaneous/apple-music-alac-atmos-downloader/AppleMusicDecrypt/src/utils.py", line 62, in helper
    result = await process(func, *args, **params)
                   │       │      │       └ {}
                   │       │      └ (SongInfo(codec='alac', raw=b'\x00\x00\x00$ftypiso5\x00\x00\x00\x01isomiso5hlsfcmfcccea\x00\x00\x03\xe9moov\x00\x00\x00lmvhd\...
                   │       └ <function decrypt at 0x106cb9120>
                   └ <function timeit.<locals>.process at 0x106cb91c0>

  File "/Users/user1/Documents/Miscellaneous/apple-music-alac-atmos-downloader/AppleMusicDecrypt/src/utils.py", line 56, in process
    return await func(*args, **params)
                 │     │       └ {}
                 │     └ (SongInfo(codec='alac', raw=b'\x00\x00\x00$ftypiso5\x00\x00\x00\x01isomiso5hlsfcmfcccea\x00\x00\x03\xe9moov\x00\x00\x00lmvhd\...
                 └ <function decrypt at 0x106cb9120>

  File "/Users/user1/Documents/Miscellaneous/apple-music-alac-atmos-downloader/AppleMusicDecrypt/src/decrypt.py", line 54, in decrypt
    raise e

  File "/Users/user1/Documents/Miscellaneous/apple-music-alac-atmos-downloader/AppleMusicDecrypt/src/decrypt.py", line 48, in decrypt
    result = await decrypt_sample(writer, reader, sample)
                   │              │       │       └ SampleInfo(data=b'\xc7\xb2\xf3.Jt\xc4\xca\xca,K!\xc4\xae\xb1\xb7fe\x88a\xd8\xcb\xe3c}\xa4 \x02\x05\x05*\x92$9\x07\xa3\\^\xdb\...
                   │              │       └ <StreamReader eof limit=16384 transport=<TCPTransport closed=False reading=False 0x106a52f00>>
                   │              └ <StreamWriter transport=<TCPTransport closed=False reading=False 0x106a52f00> reader=<StreamReader eof limit=16384 transport=...
                   └ <function decrypt_sample at 0x106cb9080>

  File "/Users/user1/Documents/Miscellaneous/apple-music-alac-atmos-downloader/AppleMusicDecrypt/src/decrypt.py", line 73, in decrypt_sample
    raise RetryableDecryptException
          └ <class 'src.exceptions.RetryableDecryptException'>

src.exceptions.RetryableDecryptException

The above exception was the direct cause of the following exception:

config.toml is same as example except for following change (as per the README)

[region]
# Used when the song region cannot be obtained, currently only used for m3u8 command and mitm command
# Recommend value: Your Apple Music's subscription region
defaultStorefront = "au"
# The language of song metadata. Influence song title, author and other information.
# Simplified Chinese: zh-Hans-CN, Tradidional Chinese(Hong Kong): zh-Hant-HK, Tradidional Chinese(Taiwan): zh-Hant-TW
# English(British): en-GB, English(American): en-US, Japanese: ja, Korean: ko
language = "en-GB"

[[devices]]
# ADB service host of Android device
#host = "127.0.0.1"
# ADB service port of Android device
#port = 58526
# For decryption service. This value should not be repeated when using multiple devices
#agentPort = 10020
# The method the script executes commands with Root permissions
# For Magisk user, the recommend value is "su -c". For other Root solutions, the recommend value is "su 0"
# If not sure which method to use, execute “su 0 ls /” and “su -c ls /” respectively in adb shell and choose the output method
#suMethod = "su -c"
host = "127.0.0.1"
port = 5555
agentPort = 10020
suMethod = "su 0"
# Inject multiple scripts into devices to simulate multi-device decryption, which can speed up decryption
# Experimental feature
hyperDecrypt = false
hyperDecryptNum = 2

Full error log: errorlog.txt

Retries yield the same result. At one point in the past I got some gpac, file doesn't exist error but that doesn't seem to be appearing anymore.

Any help would be greatly appreciated. Thanks!

WorldObservationLog commented 6 months ago

Based on the feedback received so far, the current script may support the ARM architecture, but does not support the M1 ARM architecture at all, for unknown reasons. But you can try running an x86 Android emulator through Docker on M1. It is said that Docker has implemented support for x86_64 containers through Rosetta2. And this video may help.

Roxiun commented 6 months ago

running an x86 Android emulator through Docker on M1. It is said that Docker has implemented support for x86_64 containers through Rosetta2. And this video may help.

I attempted running it through that one with no luck so far. The emulator seems to hang on booting & from the video's comments it appears other people have the same issue.

Currently I'm exploring this docker image instead: https://github.com/amrsa1/Android-Emulator-image/

Issue 10, there has a fix for running an x86_64 image on it.

However I want to check, how can I ensure that there is no Google API in the docker android image?

WorldObservationLog commented 6 months ago

running an x86 Android emulator through Docker on M1. It is said that Docker has implemented support for x86_64 containers through Rosetta2. And this video may help.

I attempted running it through that one with no luck so far. The emulator seems to hang on booting & from the video's comments it appears other people have the same issue.

Currently I'm exploring this docker image instead: https://github.com/amrsa1/Android-Emulator-image/

Issue 10, there has a fix for running an x86_64 image on it.

However I want to check, how can I ensure that there is no Google API in the docker android image?

Try to build the docker image with --build-arg TARGET=default

WorldObservationLog commented 6 months ago

Closed due to no progress. I will rent a M1 device and try to deploy the x86 Android Emulator.