librescore / dl-librescore Goto Github PK
View Code? Open in Web Editor NEWDownload sheet music
License: MIT License
Download sheet music
License: MIT License
Xmader/musescore-downloader#112
In cli:
Lines 92 to 99 in 1b9d0ac
In userscript:
Lines 80 to 89 in 1b9d0ac
npx dl-librescore@latest
https://musescore.com/user/953676/scores/9731629
Processing…/Users/michel/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:4711
return info.url;
^
TypeError: Cannot read properties of null (reading 'url')
at /Users/michel/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:4711:17
at Generator.next (<anonymous>)
at fulfilled (/Users/michel/.npm/_npx/47461c73a56e4a1f/node_modules/dl-librescore/dist/cli.js:17:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Did some quick debugging; the info
is destructured from the json that is returned. That doesn't contain an info
property, but it does contain a 404 error.
npx dl-librescore@latest -i /home/ubuntu/guitarpro-converter/temp/file_name.gp5 -o /home/ubuntu/guitarpro-converter/temp/dd.midi -t midi -v
ℹ File loaded
⠁ Processing…node:internal/deps/undici/undici:11413
Error.captureStackTrace(err, this);
^
TypeError: Failed to parse URL from /home/ubuntu/.npm/_npx/47461c73a56e4a1f/node_modules/webmscore/webmscore.lib.wasm
at Object.fetch (node:internal/deps/undici/undici:11413:11) {
[cause]: TypeError [ERR_INVALID_URL]: Invalid URL
at new NodeError (node:internal/errors:399:5)
at URL.onParseError (node:internal/url:566:9)
at new URL (node:internal/url:646:5)
at new Request (node:internal/deps/undici/undici:7002:25)
at fetch2 (node:internal/deps/undici/undici:10554:25)
at Object.fetch (node:internal/deps/undici/undici:11411:18)
at fetch (node:internal/process/pre_execution:230:25)
at instantiateAsync (/home/ubuntu/.npm/_npx/47461c73a56e4a1f/node_modules/webmscore/webmscore.nodejs.cjs:60:53226)
at createWasm (/home/ubuntu/.npm/_npx/47461c73a56e4a1f/node_modules/webmscore/webmscore.nodejs.cjs:60:53835)
at /home/ubuntu/.npm/_npx/47461c73a56e4a1f/node_modules/webmscore/webmscore.nodejs.cjs:60:266911 {
input: '/home/ubuntu/.npm/_npx/47461c73a56e4a1f/node_modules/webmscore/webmscore.lib.wasm',
code: 'ERR_INVALID_URL'
}
}
Node.js v18.15.0
i've downloaded https://musescore.com/user/7281471/scores/10054033 as midi and pdf.
comparing those two scores, the downloaded midi is missing pedal, accent, cresc., dim., slur etc.
is it fixable?
v0.34.45
via Userscript of Tampermonkey on Mac Chrome
trying to download a midi file of a score with only one instrument but two hands (like https://musescore.com/user/38111661/scores/7346651) will only download one hand
I'm getting "Score not found" error on every score, I was still able to use it last week
the pdfs appear as corrupted when i use the node.js installer and i cant download at all with the tampermonkey installer or the chrome extension.
Hello, I want to use dl-librescore to convert musz to midi, but without success. Code show as below:
npx dl-librescore@latest -i test_midi_convert/100000.mscz -t midi
npx: installed 127 in 6.27s
⠄ Processing…QZip: not a zip file!
✖ WebMscore: FILE_NO_ROOTFILE
✔ Done
npx dl-librescore@latest -i test_midi_convert/ -t midi
npx: installed 127 in 11.519s
⠄ Processing…QZip: not a zip file!
✔ Done
With a Pro+ account, I've downloaded midi files for some official scores (using the script).
These midi files contain the notes of the lyrics, but not the lyrics (text) themselves.
using this with TamperMonkey (first time user), I'm trying to download This but it does nothing.
I used the CLI to download sheets. It is working great. But I have noticed that sheets labeled as official scores get stuck while downloading there is an error that occurs.
The processing goes on forever and the file is not downloaded at all. Does the script only work for sheets labeled user scores only?
[Edit by @PeterNjeim]: Duplicate of #10
What the title says. Unofficial sheet music downloads without a problem. Here's the error message:
d:\notes>npx dl-librescore@latest
? MuseScore URL or path to file or folder:
(starts with https://musescore.com/ or is a path) right-click to paste
https://musescore.com/official_scores/scores/6953453
! ID: 6953453
Title: 21 guns - Green Day (Piano-Vocal-Guitar)
Continue? Yes
? Filetype Selection pdf
? Output Directory: d:\notes
- Processing…C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:4461
const imgtype = thumbnail.match(/score_0\.(\w+)/)[1];
^
TypeError: Cannot read properties of null (reading '1')
at get imgType [as imgType] (C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:4461:58)
at C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30929:27
at Generator.next (<anonymous>)
at C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
at new Promise (<anonymous>)
at __awaiter (C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:16:12)
at exportPDF (C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30928:41)
at C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:31456:50
at Generator.next (<anonymous>)
at C:\Users\user\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
Node.js v20.11.0
2024.03.10.can't download, ID:c67
I want to download individual part but only 3 buttons appear(PDF / MIDI / MP3)
Hey,
Love the app, thanks for all the great work !
I just discovered when running the CLI tool that if you try to change the output directory while using ~
in the path it does not seem to expand the tilde. I feel like this would be a great QOL improvement.
I could look into putting together a PR this weekend, however not certain though.
EDIT: Just saw there are no closed PRs on this repo. Do confirm to me that you'd be interested in merging it before I make one please :)
If you cannot install tampermonkey on your device, just make a bookmarklet with this code as the "link":
javascript:(function () {let code = document.createElement('script');code.src = 'https://github.com/LibreScore/dl-musescore/releases/latest/download/dl-musescore.user.js';document.body.appendChild(code);}())
When I use the "Bookmark" method the buttons load but do not do anything, and the following error appears in the console:
Uncaught (in promise) ReferenceError: i18nextInit is not defined
<anonymous> https://github.com/LibreScore/dl-librescore/releases/latest/download/dl-librescore.user.js:3981
<anonymous> https://github.com/LibreScore/dl-librescore/releases/latest/download/dl-librescore.user.js:3982
<anonymous> https://github.com/LibreScore/dl-librescore/releases/latest/download/dl-librescore.user.js:35163
dl-librescore.user.js:3981:11
TypeError: Cannot read properties of null (reading '1')
at get imgType [as imgType] (C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:4355:58)
at C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30823:27
at Generator.next ()
at C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
at new Promise ()
at __awaiter (C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:16:12)
at exportPDF (C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30822:41)
at C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:31316:50
at Generator.next ()
at C:\Users\badge\AppData\Local\npm-cache_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
Node.js v18.16.0
$ dl-librescore -i https://musescore.com/classicman/scores/63256 -t midi -v
(node:371307) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
New version is available! Current version is 0.34.60
Run npm i -g [email protected] to update
! ID: 63256
Title: Hungarian Rhapsody No. 2
⠂ Processing…/usr/lib/node_modules/dl-librescore/dist/cli.js:4699
return info.url;
^
TypeError: Cannot read properties of null (reading 'url')
at /usr/lib/node_modules/dl-librescore/dist/cli.js:4699:17
at Generator.next (<anonymous>)
at fulfilled (/usr/lib/node_modules/dl-librescore/dist/cli.js:17:58)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Node.js v21.5.0
I do see that latest version is 0.34.61 but it doesn't look like recent commits would have fixed this ? Unable to test right now (Arch repos have 0.34.60 for now)
Verified with git bisect
that this was broken by commit 772e7b3
Still works for me on commit fc99d7f
It'd be nice if the errors had actual error messages instead of being throw Error
. It's unclear right now that the CLI knowingly doesn't support downloading MIDI files.
See:
throw new Error("Unimplemented"); |
throw Error; |
---|---|
![]() |
![]() |
> npx dl-librescore@latest
? MuseScore URL or path to file or folder:
(starts with https://musescore.com/ or is a path) right-click to paste
https://musescore.com/user/39593079/scores/6950266
! ID: 6950266
Title: Do You Hear The People Sing? - Les Miserables Musical, Susan Boyle (Piano Solo)
Continue? Yes
? Filetype Selection midi, mp3, pdf
? Output Directory: %USERPROFILE%\Documents\musescore-downloads
⠁ Processing…%USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:4379
const imgtype = thumbnail.match(/score_0\.(\w+)/)[1];
^
TypeError: Cannot read properties of null (reading '1')
at get imgType [as imgType] (%USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:4379:58)
at %USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30847:27
at Generator.next (<anonymous>)
at %USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
at new Promise (<anonymous>)
at __awaiter (%USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:16:12)
at exportPDF (%USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:30846:41)
at %USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:31374:50
at Generator.next (<anonymous>)
at %USERPROFILE%\AppData\Local\npm-cache\_npx\47461c73a56e4a1f\node_modules\dl-librescore\dist\cli.js:20:71
Node.js v20.9.0
Using a Shell for-loop from a scores URL list file, downloaded hundreds of scores in a short time. The script and the browser website works fine for that while. Then suddenly the IP got banned. It returned 403 from both command line and the browser.
some blog about "web crawler" from search results said that, downloading too many data or requesting too often in a short time, would get IP banned.
I haven't found the right request interval, or data amount threshold. Could anybody point out that ?
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "function Error() { [native code] }".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v18.17.0
The script wasn't working on tampermonkey so I tried using node and it failed similarly
Samsung S7 edge. Trying to download score: https://musescore.com/user/15454861/scores/7592423
Successfully download a mscz before, but downloading this throws a network error?
MuseScore allows mxl download for some scores but requires subscription for others. Even if it is the same song but another arrangement. I don’t know why.
Edit : I’m talking about the userscript version of librescore.
I'm trying to crawl notes in musescore. Is there a way to find all the urls linking to the music scores in musescore? Thanks.
As the title, how to use command-line tool with Tor or a http proxy ?
The country has some network censoring, and many foreign sites / IP could not be accessed. As well as dl-librescore
often throw network error by direct network access.
Tried NPM config set proxy / https-proxy, Shell export proxy / https_proxy, and Windows network proxy. All does not make the access normally.
"export midi" gives midi file in which only left hand can be heard (using windows media player). musescore crashes when opening exported midi. midi is read correctly by synthesia
Is there a way to apply filters on the musescore website and then use the link like "https://musescore.com/sheetmusic?instrument=2&parts_max=1&parts_min=1&recording_type=public-domain" to download all songs that satisfy the filter? I want to download them all as musicxml with the command-line-tool.
I noticed that for some scores when I clicked Download MIDI, it would download a regular file instead. Again this is not for all scores, however, there are some I would like to download as a MIDI file.
After downloading the PDF from the terminal, There is a problem with the print size of the PDF, it's like 1/4 of the bond paper. I'm not sure but there might be artifacts generated outside of the PDF.
Thank you for the amazing library!
Some scores, which are removed from the website, can still be downloaded via Tampermonkey Userscript, however they don't work with CLI.
like this: https://musescore.com/official_author/scores/6920219
any idea why?
⠁ Processing…node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "function Error() { [native code] }".] {
code: 'ERR_UNHANDLED_REJECTION'
}
Node.js v21.7.1
pdf when downloaded and converted from command broken and not usable
It would be great if we had the librescore as a library, so we are able to import it in our project and use it or wrap some ideas around it. any thoughts? 🤔
While using the CLI, I propose implementing a feature to automatically create the file path if it does not already exist during the download process. Additionally, incorporating a prompt to ask the user before creating the path would ensure that users have control over the path creation. This approach combines both the convenience of automatic path creation and the user's autonomy in the process.
The download buttons don't seem to appear correctly. They work, but they're totally stuck at the bottom right corner of the screen, constantly hiding that part and pretty inconvenient. I took the screenshot below with uBlock Origin and Dark Reader enabled, but this happens regardless of whether other extensions are enabled, so it can't be interference.
I've observed this issue with:
Violentmonkey, Firefox, Linux
Tampermonkey, Firefox, Linux
Violentmonkey, Opera, Windows 7
Violentmonkey, Opera GX, Windows 10
I also tried Firemonkey and Greasemonkey just in case, but the userscript didn't work at all there.
I know for a fact this used to work fine a long time ago (it's probably been a couple of years at this point) and would place the download buttons below the Share/Add to set buttons. It just suddenly broke one day and I didn't think to open an issue until now.
Currently, using Tampermonkey does not load the button.
Forcing via the bookmark method or console loading gives the buttons back, but it also gives an error on download.
Error: token timeout
timer https://musescore.com/user/28830767/scores/5578605:26753
setTimeout handler*getApiAuth/</< https://musescore.com/user/28830767/scores/5578605:26752
getApiAuth https://musescore.com/user/28830767/scores/5578605:26751
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
getApiAuth https://musescore.com/user/28830767/scores/5578605:26697
getFileUrl https://musescore.com/user/28830767/scores/5578605:26779
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
getFileUrl https://musescore.com/user/28830767/scores/5578605:26776
rs https://musescore.com/user/28830767/scores/5578605:26817
exportPDF https://musescore.com/user/28830767/scores/5578605:26810
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
exportPDF https://musescore.com/user/28830767/scores/5578605:26807
downloadPDF https://musescore.com/user/28830767/scores/5578605:26835
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
downloadPDF https://musescore.com/user/28830767/scores/5578605:26830
action https://musescore.com/user/28830767/scores/5578605:31358
process https://musescore.com/user/28830767/scores/5578605:31214
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
process https://musescore.com/user/28830767/scores/5578605:31209
onclick https://musescore.com/user/28830767/scores/5578605:31082
cloneBtn https://musescore.com/user/28830767/scores/5578605:31032
_commit https://musescore.com/user/28830767/scores/5578605:31128
_commit https://musescore.com/user/28830767/scores/5578605:31128
commit https://musescore.com/user/28830767/scores/5578605:31157
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
commit https://musescore.com/user/28830767/scores/5578605:31152
observer https://musescore.com/user/28830767/scores/5578605:31372
main https://musescore.com/user/28830767/scores/5578605:31315
main https://musescore.com/user/28830767/scores/5578605:31313
promise callback*a https://musescore.com/user/28830767/scores/5578605:31382
onload https://musescore.com/user/28830767/scores/5578605:313845578605:31218:31
process https://musescore.com/user/28830767/scores/5578605:31218
rejected https://musescore.com/user/28830767/scores/5578605:8
(Async: promise callback)
step https://musescore.com/user/28830767/scores/5578605:9
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
process https://musescore.com/user/28830767/scores/5578605:31209
onclick https://musescore.com/user/28830767/scores/5578605:31082
(Async: EventHandlerNonNull)
cloneBtn https://musescore.com/user/28830767/scores/5578605:31032
_commit https://musescore.com/user/28830767/scores/5578605:31128
_commit https://musescore.com/user/28830767/scores/5578605:31128
commit https://musescore.com/user/28830767/scores/5578605:31157
__awaiter https://musescore.com/user/28830767/scores/5578605:10
__awaiter https://musescore.com/user/28830767/scores/5578605:6
commit https://musescore.com/user/28830767/scores/5578605:31152
observer https://musescore.com/user/28830767/scores/5578605:31372
(Async: MutationCallback)
main https://musescore.com/user/28830767/scores/5578605:31315
main https://musescore.com/user/28830767/scores/5578605:31313
(Async: promise callback)
a https://musescore.com/user/28830767/scores/5578605:31382
onload https://musescore.com/user/28830767/scores/5578605:31384
here is my log:
% npx dl-librescore@latest
(node:76305) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? MuseScore URL or path to file or folder:
(starts with https://musescore.com/ or is a path)
https://musescore.com/user/668541/scores/2469096
! ID: 2469096
Title: The Frog Galliard (Piano)
Continue? Yes
? Filetype Selection pdf
? Output Directory: /Users/halpz/Downloads
⠁ Processing…node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^
[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "function Error() { [native code] }".] {
code: 'ERR_UNHANDLED_REJECTION'
}
I tried both the bookmark (in chrome and safari), and the shortcut, they both display the buttons, but pressing the PDF and MP3 buttons say “processing…” but never download anything, and the MIDI button does nothing at all.
There are also no error codes.
Was working yesterday albeit had to refresh the page a couple times to get it to download a midi from musescore, today can't get any to download. Clicked the download midi option and it just says processing for a couple seconds then nothing.
Using the tampermonkey with user script option
I am sorry if it isn't but it was just working yesterday but, not anymore
although midi and mp3 work fine
I used to use this a lot, but for some reason the download options don't appear at the bottom. So what do I do?
The old repo (https://github.com/Xmader/musescore-downloader) still shows up first in many search results, which is how I found it. Only after visiting some issues, I found out that the project had moved.
If possible, please add a prominent note to the beginning of the old repo's README that the old project has migrated here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.