v0.15.2
This commit is contained in:
parent
d2956ad9d5
commit
43d8b46768
|
@ -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.1
|
// @version 0.15.2
|
||||||
// @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/*/*
|
||||||
|
@ -26469,7 +26469,7 @@ Please pipe the document into a Node stream.\
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
||||||
const CHUNK_PUSH_FN = 'function a(a){';
|
const CHUNK_PUSH_FN = /^function [^r]\(\w\){/;
|
||||||
const moduleLookup = (id, globalWebpackJson) => {
|
const moduleLookup = (id, globalWebpackJson) => {
|
||||||
const pack = globalWebpackJson.find(x => x[1][id]);
|
const pack = globalWebpackJson.find(x => x[1][id]);
|
||||||
return pack[1][id];
|
return pack[1][id];
|
||||||
|
@ -26541,7 +26541,7 @@ Please pipe the document into a Node stream.\
|
||||||
get() { return jsonp; },
|
get() { return jsonp; },
|
||||||
set(v) {
|
set(v) {
|
||||||
jsonp = v;
|
jsonp = v;
|
||||||
if (!hooked && v.push.toString().includes(CHUNK_PUSH_FN)) {
|
if (!hooked && v.push.toString().match(CHUNK_PUSH_FN)) {
|
||||||
hooked = true;
|
hooked = true;
|
||||||
hookNative(v, 'push', (_fn) => {
|
hookNative(v, 'push', (_fn) => {
|
||||||
return function (pack) {
|
return function (pack) {
|
||||||
|
@ -26559,49 +26559,48 @@ Please pipe the document into a Node stream.\
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/* eslint-disable no-extend-native */
|
/* eslint-disable no-extend-native */
|
||||||
const FILE_URL_MODULE_ID = 'iNJA';
|
const AUTH_MODULE_ID = 'UeBv';
|
||||||
const ARG_NUMBER = 4;
|
const MAGIC_ARG_INDEX = 1;
|
||||||
const MAGIC_ARG_INDEX = 3;
|
|
||||||
/**
|
/**
|
||||||
* I know this is super hacky.
|
* I know this is super hacky.
|
||||||
*/
|
*/
|
||||||
let magic = new Promise((resolve) => {
|
let magic = new Promise((resolve) => {
|
||||||
// todo: hook module by what it does, not what it is called
|
// todo: hook module by what it does, not what it is called
|
||||||
webpackGlobalOverride(ALL, (_, r, t) => {
|
webpackGlobalOverride(AUTH_MODULE_ID, (n, r, t) => {
|
||||||
const fn = r.a;
|
const fn = n.exports;
|
||||||
if (typeof fn === 'function' && fn.length === ARG_NUMBER) {
|
n.exports = (...args) => {
|
||||||
t.d(r, 'a', () => {
|
if (magic instanceof Promise) {
|
||||||
return (...args) => {
|
magic = args[MAGIC_ARG_INDEX];
|
||||||
if (magic instanceof Promise) {
|
resolve(magic);
|
||||||
if (args.every(a => typeof a === 'number' || typeof a === 'string')) {
|
}
|
||||||
magic = args[MAGIC_ARG_INDEX];
|
return fn(...args);
|
||||||
resolve(magic);
|
};
|
||||||
}
|
|
||||||
}
|
|
||||||
return fn(...args);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
const getFileUrl = (type, index = 0) => __awaiter(void 0, void 0, void 0, function* () {
|
const getApiUrl = (type, index) => {
|
||||||
const fileUrlModule = webpackHook(FILE_URL_MODULE_ID, {
|
return `/api/jmuse?id=${scoreinfo.id}&type=${type}&index=${index}`;
|
||||||
'6Ulw'(_, r, t) {
|
};
|
||||||
t.d(r, 'a', () => {
|
const getApiAuth = (type, index) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
return type;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
const fn = fileUrlModule.a;
|
|
||||||
if (magic instanceof Promise) {
|
if (magic instanceof Promise) {
|
||||||
// force to retrieve the MAGIC
|
// force to retrieve the MAGIC
|
||||||
const el = document.querySelectorAll('.SD7H- > button')[3];
|
const el = document.querySelectorAll('.SD7H- > button')[3];
|
||||||
el.click();
|
el.click();
|
||||||
magic = yield magic;
|
magic = yield magic;
|
||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
const str = String(scoreinfo.id) + type + String(index);
|
||||||
return fn(undefined, scoreinfo.id, index, resolve, magic);
|
const fn = webpackHook(AUTH_MODULE_ID);
|
||||||
|
return fn(str, magic);
|
||||||
|
});
|
||||||
|
const getFileUrl = (type, index = 0) => __awaiter(void 0, void 0, void 0, function* () {
|
||||||
|
const url = getApiUrl(type, index);
|
||||||
|
const auth = yield getApiAuth(type, index);
|
||||||
|
const r = yield fetch(url, {
|
||||||
|
headers: {
|
||||||
|
Authorization: auth,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
const { info } = yield r.json();
|
||||||
|
return info.url;
|
||||||
});
|
});
|
||||||
|
|
||||||
let pdfBlob;
|
let pdfBlob;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "musescore-downloader",
|
"name": "musescore-downloader",
|
||||||
"version": "0.15.1",
|
"version": "0.15.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "musescore-downloader",
|
"name": "musescore-downloader",
|
||||||
"version": "0.15.1",
|
"version": "0.15.2",
|
||||||
"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