Skip to content

Commit

Permalink
Merge pull request #9 from roogue/v2.7.0
Browse files Browse the repository at this point in the history
v2.7.0 updates
  • Loading branch information
roogue authored Jan 9, 2023
2 parents 7e4fbf2 + c8844c3 commit 8aeb941
Show file tree
Hide file tree
Showing 25 changed files with 1,156 additions and 455 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#beatmap
*.osz
*.osdb

# Logs
logs
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"domcontentloaded",
"Ocdl",
"Osdb",
"taiko",
"undici"
]
}
64 changes: 42 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,49 +1,69 @@
# osu-collector-dl

A Script that automatizes the downloads of beatmap set in Osu!Collector.
A script that automates the downloading of beatmap sets in Osu!Collector.

## Installation

- Download from the latest release, then extract the compressed file.
1. Download the latest release from the releases page.
2. Extract the compressed file

## Usage

Run the `osu-collector-dl.exe` from the downloaded folder.
1. Run the `osu-collector-dl.exe` file from the downloaded folder.
2. A prompt window will appear. You will need to enter the ID of the collection you want to download. To find the ID, look at the end of the Osu!Collector collection URL. For example, if the URL is https://osucollector.com/collections/44, you would enter 44 as the ID.

After a prompt window pops up, an ID is required. You have to insert the numbers that appear at the end of the Osu!Collector collection url.
For an example: Insert "44" if you want to download from this link: https://osucollector.com/collections/44
## Configuration

## Config
You can customize various settings that affect the download speed, location of the downloaded beatmaps, and working mode of the script by editing the `config.json` file. To do this, right-click on the file and select "Open with" from the context menu. Choose a text editor (such as Notepad) to open the file and make the desired changes.

You can customize some settings which affect in download speed, location of the downloaded osu beatmaps and working mode.

Below is the data stored in `config.json`, you can modify it to your flavor. \
(Tips: Right click and open with notepad to edit .json file.)
Below is the data stored in config.json, along with explanations of each setting:

```json
{
"parallel": true,
"dl_impulse_rate": 10,
"concurrency": 5,
"logSize": 15,
"directory": "",
"mode": 1
}
```

#### Explanation:
- `parallel`: Set to `true` if you want to download multiple beatmap sets at the same time, or `false` if you want to download only one beatmap set at a time.

- `concurrency`: The number of downloads to request at a time. It is recommended to set this to a low number (such as 5) to prevent abuse of the osu!mirror API and potential IP bans or rate limits.

- `logSize`: The number that determines the maximum number of log messages during the download process.

- `directory`: The path to the folder where you want to save the downloaded beatmaps. If no value is provided, the current working directory will be used. Remember to include double quotes around the path!

- `mode`: The mode in which the program should operate. Set to `1` to only download the beatmap sets, or `2` to also generate a .osdb file during the download process. You can also specify the mode at the terminal.

## FAQ

### It says "Retrying" during the download process, am I doing anything wrong?

> No, you are not doing anything wrong. It is normal for API requests to sometimes fail due to factors such as rate limiting and internet connection issues. The script has a built-in retrying process that will handle these issues automatically. It is expected to see the "Retrying" message during the download process.
### I want the beatmaps to be automatically added to my collections. Is that possible?

> Unfortunately, this feature will not be implemented as directly modifying your personal osu! folder is risky and could potentially result in corrupted files. It is recommended to use [Collection Manager](https://github.com/Piotrekol/CollectionManager) (CM) by Piotrekol to modify your collection for more stable functionality.
### Why won't my program even start? The program shuts off right after I opened it.

> There could be several reasons why your program is not starting. One potential cause is that you have incorrectly edited the config.json file, such as forgetting to include double quotes around the directory path. If you are not sure what the problem is, try reinstalling the program to see if that resolves the issue.
### The program freezes in the middle of the process without displaying any error messages. What can I do?

> One possible solution is to try pressing Enter on your keyboard to see if that prompts the program to continue. This can sometimes happen if you accidentally clicked on the terminal window, which can cause the program to pause.
[ parallel: true | false ] - Whether or not downloads should be done in parallel. \
-> If parallel is true, multiple downloads will process at the same time. If false, the program will download only one beatmap set at a time.
### I accidentally downloaded the wrong collection. How can I stop the downloads?

[ dl_impulse_rate: number ] - How many downloads should be requested at a time. \
-> Warning: this setting is recommended to be set as low as around 5 to prevent unwanted abuse to osu!mirror API. You could get IP banned or rate limited if you're abusing their API (I guess :v but just don't).
> To stop the downloads, you can simply close the terminal window. This will terminate the program. Alternatively, you can try pressing CTRL+C on your keyboard, which will send a signal to the program to stop running.
[ directory: string ] - Path to your download folder. \
-> Remember the double quotes!! If none was provided, the current working directory would be used.
### I have tried following the FAQ above, but it didn't solve my problem. The problem I am experiencing is not listed in the FAQ.

[ mode: 1 | 2 ] - Which mode should the program works on. \
-> When mode 1 is selected, only download of the beatmap sets will be progressed. If mode 2 is selected, the download will still be progressed but with an additional generation of .osdb file. \
Note: You can still choose a mode on the terminal.
> If you are experiencing a problem that is not covered in the FAQ and you need assistance, it is welcome to open an issue on the [Issue Page](https://github.com/roogue/osu-collector-dl/issues). After navigating to the issue page, click the green "New issue" button on the page and follow the instructions to describe your problem in as much detail as possible. This will allow the maintainers of the project to better understand and help troubleshoot the issue you are experiencing.
## License

[MIT](https://choosealicense.com/licenses/mit/)
This project is licensed under the MIT License. See the [LICENSE](https://choosealicense.com/licenses/mit/) file for details.
3 changes: 2 additions & 1 deletion config.json.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"parallel": true,
"dl_impulse_rate": 5,
"concurrency": 5,
"logSize": 15,
"directory": "",
"mode": 1
}
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"name": "osu-collector-dl",
"version": "2.6.5",
"version": "2.7.0",
"main": "./dist/index.js",
"scripts": {
"build": "yarn run build-app && yarn run cp-build",
"build": "yarn run clean-folder && yarn run build-app && yarn run cp-build",
"start": "yarn build-ts && node .",
"build-ts": "tsc -p .",
"build-app-win": "yarn build-ts && pkg -t node16-win-x64 -o ./build/win-x64/osu-collector-dl.exe ./dist/index.js --public",
"build-app-linux": "yarn build-ts && pkg -t node16-linux -o ./build/linux-arm64/osu-collector-dl ./dist/index.js --public",
"build-app": "yarn build-app-win && yarn build-app-linux",
"cp-build-win": "cp ./{LICENSE,README.md} ./build/win-x64/ && cp ./config.json.example ./build/win-x64/config.json",
"cp-build-linux": "cp ./{LICENSE,README.md} ./build/linux-arm64/ && cp ./config.json.example ./build/linux-arm64/config.json",
"cp-build": "yarn cp-build-win && yarn cp-build-linux"
"cp-build": "yarn cp-build-win && yarn cp-build-linux",
"clean-folder": "rm -r ./build"
},
"license": "MIT",
"dependencies": {
"chalk": "4.1.2",
"csbinary": "^2.1.4",
"prompt-sync": "^4.2.0",
"tslib": "^2.4.0",
"undici": "^5.8.0"
"tslib": "^2.4.1",
"undici": "^5.14.0"
},
"devDependencies": {
"@types/node": "^18.0.6"
Expand Down
9 changes: 0 additions & 9 deletions src/config.ts

This file was deleted.

Loading

0 comments on commit 8aeb941

Please sign in to comment.