Skip to content

Instantly share code, notes, and snippets.

@zzjtnb
Forked from rsp4jack/main.js
Created May 2, 2023 09:38
Show Gist options
  • Save zzjtnb/1774e9c4445f25115d5b6800359874e8 to your computer and use it in GitHub Desktop.
Save zzjtnb/1774e9c4445f25115d5b6800359874e8 to your computer and use it in GitHub Desktop.
betterncm plugin, MIT License
globalThis.TrackHck = function (t) {
var o = this.eN()[t];
var trk = o && (o.track && o.track.track ? o.track.track : o.track || o);
if (!trk) {
return o;
}
var f = trk.privilege;
if (!f) {
return o;
}
var bitrate = f.maxSongBr;
if (Number.isNaN(bitrate)) {
bitrate = f.maxFreeBr;
}
f.maxPlayBr = bitrate;
f.maxDownBr = bitrate;
f.payed = 1;
return o;
};
plugin.onLoad(function () {
console.log("Hello!");
});
{
"manifest_version": 1,
"name": "unblockprivileges",
"version": "0.0.1",
"author": "John Doe",
"description": "Unblock privileges of songs",
"betterncm_version": ">=0.2.5",
"injects": {
"Main": [
{
"file": "./main.js"
}
]
},
"hijacks": {
"> 2.10.6 <= 2.10.8":{
"orpheus://orpheus/pub/core":{
"type": "replace",
"id": "privilegehck",
"from": "return this.eN()[t]",
"to": "if (!globalThis.TrackHck) return this.eN()[t]; return TrackHck.call(this, t)"
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment