v0.15.10
This commit is contained in:
parent
5426ad5059
commit
f68a2ddada
|
@ -5,7 +5,7 @@
|
||||||
// @supportURL https://github.com/Xmader/musescore-downloader/issues
|
// @supportURL https://github.com/Xmader/musescore-downloader/issues
|
||||||
// @updateURL https://msdl.librescore.org/install.user.js
|
// @updateURL https://msdl.librescore.org/install.user.js
|
||||||
// @downloadURL https://msdl.librescore.org/install.user.js
|
// @downloadURL https://msdl.librescore.org/install.user.js
|
||||||
// @version 0.15.9
|
// @version 0.15.10
|
||||||
// @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱
|
// @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱
|
||||||
// @author Xmader
|
// @author Xmader
|
||||||
// @match https://musescore.com/*/*
|
// @match https://musescore.com/*/*
|
||||||
|
@ -26537,46 +26537,46 @@ Please pipe the document into a Node stream.\
|
||||||
resolve(t);
|
resolve(t);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
const PACK_ID_REG = /\+(\{.*?"\})\[\w\]\+/;
|
||||||
/* eslint-disable no-extend-native */
|
const loadAllPacks = () => {
|
||||||
const AUTH_REG = /,((\d+\.\..+?)?function\(\)\{var \w=Array.prototype.slice.*?)\)(\[|\.then)/;
|
return webpackContext.then((ctx) => {
|
||||||
const PACK_ID_REG = /\((\{.*?"\})\[\w\]\|\|\w\)/;
|
|
||||||
const packIdPromise = webpackContext.then((ctx) => {
|
|
||||||
const ids = {
|
|
||||||
img: '9',
|
|
||||||
midi: '',
|
|
||||||
mp3: '',
|
|
||||||
};
|
|
||||||
try {
|
try {
|
||||||
const fn = ctx.e.toString();
|
const fn = ctx.e.toString();
|
||||||
const packsData = fn.match(PACK_ID_REG)[1];
|
const packsData = fn.match(PACK_ID_REG)[1];
|
||||||
// eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval
|
// eslint-disable-next-line no-new-func, @typescript-eslint/no-implied-eval
|
||||||
const packs = Function(`return (${packsData})`)();
|
const packs = Function(`return (${packsData})`)();
|
||||||
Object.entries(packs).forEach(([id, name]) => {
|
Object.keys(packs).forEach((id) => {
|
||||||
if (name.includes('audio') && !ids['mp3'])
|
ctx.e(id);
|
||||||
ids['mp3'] = id;
|
|
||||||
if (name.includes('piano_roll') && !ids['midi'])
|
|
||||||
ids['midi'] = id;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
return ids;
|
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/* eslint-disable no-extend-native */
|
||||||
|
const AUTH_REG = /,((\d+\.\..+?)?function\(\)\{var \w=Array.prototype.slice.*?)\)(\[|\.then)/;
|
||||||
|
var PACK_HINT;
|
||||||
|
(function (PACK_HINT) {
|
||||||
|
PACK_HINT["img"] = "getImageRef";
|
||||||
|
PACK_HINT["midi"] = "midi:";
|
||||||
|
PACK_HINT["mp3"] = "setVolume:";
|
||||||
|
})(PACK_HINT || (PACK_HINT = {}));
|
||||||
/**
|
/**
|
||||||
* I know this is super hacky.
|
* I know this is super hacky.
|
||||||
*/
|
*/
|
||||||
const magicHookConstr = (type) => __awaiter(void 0, void 0, void 0, function* () {
|
const magicHookConstr = (type) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
const packId = yield packIdPromise;
|
|
||||||
// request pack
|
// request pack
|
||||||
// eslint-disable-next-line no-void, @typescript-eslint/no-unsafe-return
|
yield loadAllPacks();
|
||||||
void webpackContext.then((ctx) => ctx.e(packId[type]));
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
onPackLoad((pack) => {
|
onPackLoad((pack) => {
|
||||||
if (pack[0].includes(packId[type]) || pack[0].includes(+packId[type])) {
|
|
||||||
Object.values(pack[1]).forEach((mod) => {
|
Object.values(pack[1]).forEach((mod) => {
|
||||||
const m = mod.toString().match(AUTH_REG);
|
const str = mod.toString();
|
||||||
|
if (!str.includes(PACK_HINT[type])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const m = str.match(AUTH_REG);
|
||||||
if (m) {
|
if (m) {
|
||||||
const code = m[1];
|
const code = m[1];
|
||||||
try {
|
try {
|
||||||
|
@ -26589,7 +26589,6 @@ Please pipe the document into a Node stream.\
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "musescore-downloader",
|
"name": "musescore-downloader",
|
||||||
"version": "0.15.9",
|
"version": "0.15.10",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "musescore-downloader",
|
"name": "musescore-downloader",
|
||||||
"version": "0.15.9",
|
"version": "0.15.10",
|
||||||
"description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱",
|
"description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue