mirror of
https://github.com/zhaarey/AppleMusicDecrypt.git
synced 2025-10-23 15:11:06 +00:00
fix: retry when raise ConnectionRefusedError
This commit is contained in:
@@ -18,7 +18,12 @@ retry_count = {}
|
|||||||
async def decrypt(info: SongInfo, keys: list[str], manifest: Datum, device: Device) -> bytes:
|
async def decrypt(info: SongInfo, keys: list[str], manifest: Datum, device: Device) -> bytes:
|
||||||
async with device.decryptLock:
|
async with device.decryptLock:
|
||||||
logger.info(f"Decrypting song: {manifest.attributes.artistName} - {manifest.attributes.name}")
|
logger.info(f"Decrypting song: {manifest.attributes.artistName} - {manifest.attributes.name}")
|
||||||
reader, writer = await asyncio.open_connection(device.host, device.fridaPort)
|
try:
|
||||||
|
reader, writer = await asyncio.open_connection(device.host, device.fridaPort)
|
||||||
|
except ConnectionRefusedError:
|
||||||
|
logger.warning(f"Failed to connect to device {device.device.serial}, re-injecting")
|
||||||
|
device.restart_inject_frida()
|
||||||
|
raise RetryableDecryptException
|
||||||
decrypted = bytes()
|
decrypted = bytes()
|
||||||
last_index = 255
|
last_index = 255
|
||||||
for sample in info.samples:
|
for sample in info.samples:
|
||||||
|
|||||||
Reference in New Issue
Block a user