roogue / osu-collector-dl

Automatic Downloader for Osu!Collector
MIT License
40 stars 4 forks source link

Collections with forward slashes in their names result in an ENOENT error #4

Closed hinuiiik closed 2 years ago

hinuiiik commented 2 years ago

I'm on linux so I don't know if this error also occurs on windows.

Example Collection: https://osucollector.com/collections/1409

Terminal Output:

Please Enter An ID: 1409
node:fs:1349
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, mkdir '/home/user/Downloads/linux-arm64/Streams/Death'
    at Object.mkdirSync (node:fs:1349:3)
    at mkdirSync (pkg/prelude/bootstrap.js:1642:33)
    at Main.run (/snapshot/osu-collector-dl/dist/core/Main.js:45:28)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async /snapshot/osu-collector-dl/dist/index.js:10:5 {
  errno: -2,
  syscall: 'mkdir',
  code: 'ENOENT',
  path: '/home/user/Downloads/linux-arm64/Streams/Death'
}

I imagine a potential solution to this would be checking for path separators and other illegal characters and replacing them with another character like an underscore.

roogue commented 2 years ago

I see, I had totally forgotten this on mkdir. Thanks for your report :)

roogue commented 2 years ago

Close as fixed: v2.6.1: https://github.com/roogue/osu-collector-dl/releases/tag/v2.6.1 commit: b95819be751e46acafccb33bf1aa91d51ccee241