v0.1.1 - debug
This commit is contained in:
parent
138dedae65
commit
3c667fcdfb
4 changed files with 18 additions and 9 deletions
6
dist/main.js
vendored
6
dist/main.js
vendored
|
@ -3,7 +3,7 @@
|
||||||
// @namespace https://www.xmader.com/
|
// @namespace https://www.xmader.com/
|
||||||
// @homepageURL https://github.com/Xmader/musescore-downloader/
|
// @homepageURL https://github.com/Xmader/musescore-downloader/
|
||||||
// @supportURL https://github.com/Xmader/musescore-downloader/issues
|
// @supportURL https://github.com/Xmader/musescore-downloader/issues
|
||||||
// @version 0.1.0
|
// @version 0.1.1
|
||||||
// @description 免登录、免 Musescore Pro,下载 musescore.com 上的曲谱
|
// @description 免登录、免 Musescore Pro,下载 musescore.com 上的曲谱
|
||||||
// @author Xmader
|
// @author Xmader
|
||||||
// @match https://musescore.com/user/*/scores/*
|
// @match https://musescore.com/user/*/scores/*
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
const { id, vid } = scorePlayer.json;
|
const { id, vid } = scorePlayer.json;
|
||||||
const baseURL = scorePlayer.urls.image_path;
|
const baseURL = scorePlayer.urls.image_path;
|
||||||
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1];
|
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1];
|
||||||
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath}/${id}/score_${vid}_${scoreHexId}.mscz`;
|
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath(id)}/${id}/score_${vid}_${scoreHexId}.mscz`;
|
||||||
const pdfURL = baseURL + "score_full.pdf";
|
const pdfURL = baseURL + "score_full.pdf";
|
||||||
const mxlURL = baseURL + "score.mxl";
|
const mxlURL = baseURL + "score.mxl";
|
||||||
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls;
|
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls;
|
||||||
|
@ -48,6 +48,8 @@
|
||||||
btn.onclick = () => {
|
btn.onclick = () => {
|
||||||
window.open(url);
|
window.open(url);
|
||||||
};
|
};
|
||||||
|
const span = downloadBtn.querySelector("span");
|
||||||
|
span.textContent = `Download ${name}`;
|
||||||
return btn;
|
return btn;
|
||||||
});
|
});
|
||||||
downloadBtn.replaceWith(...newDownloadBtns);
|
downloadBtn.replaceWith(...newDownloadBtns);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "musescore-downloader",
|
"name": "musescore-downloader",
|
||||||
"version": "0.1.0",
|
"version": "0.1.1",
|
||||||
"description": "免登录、免 Musescore Pro,下载 musescore.com 上的曲谱",
|
"description": "免登录、免 Musescore Pro,下载 musescore.com 上的曲谱",
|
||||||
"main": "dist/main.js",
|
"main": "dist/main.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
|
@ -1,17 +1,21 @@
|
||||||
import typescript from "rollup-plugin-typescript"
|
import typescript from "rollup-plugin-typescript"
|
||||||
import fs from "fs"
|
import fs from "fs"
|
||||||
import { version } from "./package.json"
|
|
||||||
|
|
||||||
let bannerText = fs.readFileSync("./src/meta.js", "utf-8")
|
const getBannerText = () => {
|
||||||
bannerText = bannerText.replace("%VERSION%", version)
|
const packageJson = JSON.parse(fs.readFileSync("./package.json", "utf-8"))
|
||||||
|
const { version } = packageJson
|
||||||
|
let bannerText = fs.readFileSync("./src/meta.js", "utf-8")
|
||||||
|
bannerText = bannerText.replace("%VERSION%", version)
|
||||||
|
return bannerText
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
input: "src/main.ts",
|
input: "src/main.ts",
|
||||||
output: {
|
output: {
|
||||||
file: "dist/main.js",
|
file: "dist/main.js",
|
||||||
format: "iife",
|
format: "iife",
|
||||||
banner: bannerText,
|
|
||||||
sourcemap: false,
|
sourcemap: false,
|
||||||
|
banner: getBannerText,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
typescript({
|
typescript({
|
||||||
|
@ -21,6 +25,6 @@ export default {
|
||||||
"ES6",
|
"ES6",
|
||||||
"dom"
|
"dom"
|
||||||
],
|
],
|
||||||
})
|
}),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ const { id, vid } = scorePlayer.json
|
||||||
const baseURL = scorePlayer.urls.image_path
|
const baseURL = scorePlayer.urls.image_path
|
||||||
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1]
|
const scoreHexId = baseURL.split("/").filter(Boolean).reverse()[1]
|
||||||
|
|
||||||
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath}/${id}/score_${vid}_${scoreHexId}.mscz`
|
const msczURL = `https://musescore.com/static/musescore/scoredata/score/${getIndexPath(id)}/${id}/score_${vid}_${scoreHexId}.mscz`
|
||||||
const pdfURL = baseURL + "score_full.pdf"
|
const pdfURL = baseURL + "score_full.pdf"
|
||||||
const mxlURL = baseURL + "score.mxl"
|
const mxlURL = baseURL + "score.mxl"
|
||||||
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls
|
const { midi: midiURL, mp3: mp3URL } = scorePlayer.urls
|
||||||
|
@ -35,6 +35,9 @@ const newDownloadBtns = Object.keys(downloadURLs).map((name) => {
|
||||||
window.open(url)
|
window.open(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const span = downloadBtn.querySelector("span")
|
||||||
|
span.textContent = `Download ${name}`
|
||||||
|
|
||||||
return btn
|
return btn
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue