musescore-downloader

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 1bb2a0683d2019a019276debc3ff02edc76935a2
parent 2745ff9e53b2ecd7ff0be72f023550b3bb6c10d3
Author: Xmader <xmader@outlook.com>
Date:   Sun,  8 Mar 2020 17:44:20 -0400

v0.6.1

Diffstat:
Mdist/main.js | 10++++++++--
Mpackage.json | 2+-
Msrc/main.ts | 12+++++++++++-
3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/dist/main.js b/dist/main.js @@ -3,7 +3,7 @@ // @namespace https://www.xmader.com/ // @homepageURL https://github.com/Xmader/musescore-downloader/ // @supportURL https://github.com/Xmader/musescore-downloader/issues -// @version 0.6.0 +// @version 0.6.1 // @description download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱 // @author Xmader // @match https://musescore.com/*/* @@ -28965,8 +28965,14 @@ Please pipe the document into a Node stream.\ } else if (name == "MSCZ") { btn.onclick = () => __awaiter(void 0, void 0, void 0, function* () { + const text = textNode.textContent; + textNode.textContent = "Processing…"; const token = yield execute(); - window.open(url + token); + const filename = getScoreFileName(scorePlayer); + const r = yield fetch(url + token); + const data = yield r.blob(); + textNode.textContent = text; + saveAs(data, `${filename}.mscz`); }); } else { diff --git a/package.json b/package.json @@ -1,6 +1,6 @@ { "name": "musescore-downloader", - "version": "0.6.0", + "version": "0.6.1", "description": "download sheet music from musescore.com for free, no login or Musescore Pro required | 免登录、免 Musescore Pro,免费下载 musescore.com 上的曲谱", "main": "dist/main.js", "repository": { diff --git a/src/main.ts b/src/main.ts @@ -136,8 +136,18 @@ const main = () => { } } else if (name == "MSCZ") { btn.onclick = async () => { + const text = textNode.textContent + textNode.textContent = "Processing…" + const token = await recaptcha.execute() - window.open(url + token) + const filename = getScoreFileName(scorePlayer) + + const r = await fetch(url + token) + const data = await r.blob() + + textNode.textContent = text + + saveAs(data, `${filename}.mscz`) } } else { btn.onclick = () => {