Skip to content

Commit

Permalink
feat: get the best m3u8 without binding device and account (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaarey authored Jun 1, 2024
1 parent 019689b commit 9b1e7f3
Showing 1 changed file with 15 additions and 20 deletions.
35 changes: 15 additions & 20 deletions agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -195,4 +190,4 @@ setTimeout(() => {
handleConnection(await listener.accept());
}
}).catch(console.log);
}, 4000);
}, 4000);

0 comments on commit 9b1e7f3

Please sign in to comment.