From 9b1e7f3457d5736bb41a243e2136535199bb2278 Mon Sep 17 00:00:00 2001 From: zhaarey <157944548+zhaarey@users.noreply.github.com> Date: Sun, 2 Jun 2024 01:01:35 +0800 Subject: [PATCH] feat: get the best m3u8 without binding device and account (maybe) --- agent.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/agent.js b/agent.js index 7c361f1..c5bfb99 100644 --- a/agent.js +++ b/agent.js @@ -101,25 +101,20 @@ setTimeout(() => { await s.close(); } global.getM3U8 = function(adamID) { - var C3282k = Java.use("c.a.a.e.o.k"); - var m7125s = C3282k.a().s(); - var PurchaseRequest$PurchaseRequestPtr = Java.use("com.apple.android.storeservices.javanative.account.PurchaseRequest$PurchaseRequestPtr"); - - var c3249t = Java.cast(m7125s, Java.use("c.a.a.e.k.t")); - var create = PurchaseRequest$PurchaseRequestPtr.create(c3249t.n.value); - create.get().setProcessDialogActions(true); - create.get().setURLBagKey("subDownload"); - create.get().setBuyParameters(`salableAdamId=${adamID}&price=0&pricingParameters=SUBS&productType=S`); - create.get().run(); - var response = create.get().getResponse(); - if (response.get().getError().get() == null) { - var item = response.get().getItems().get(0); - var assets = item.get().getAssets(); - var size = assets.size(); - return assets.get(size - 1).get().getURL(); - } else { - return response.get().getError().get().errorCode(); - } + Java.use("com.apple.android.music.common.MainContentActivity"); + var SVPlaybackLeaseManagerProxy; + Java.choose("com.apple.android.music.playback.SVPlaybackLeaseManagerProxy", { + onMatch: function (x) { + SVPlaybackLeaseManagerProxy = x + }, + onComplete: function (x) {} + }); + var HLSParam = Java.array('java.lang.String', ["HLS"]) + var MediaAssetInfo = SVPlaybackLeaseManagerProxy.requestAsset(parseInt(adamID), HLSParam, false) + if (MediaAssetInfo === null) { + return -1 + } + return MediaAssetInfo.getDownloadUrl() }; function performJavaOperations(adamID) { @@ -195,4 +190,4 @@ setTimeout(() => { handleConnection(await listener.accept()); } }).catch(console.log); -}, 4000); \ No newline at end of file +}, 4000);