1. osu! forums
  2. osu!
  3. Development
posted
Hi,

i was looking for a program, which copies all songs (.mp3 files) into one folder and renames them (sometimes they are just called audio.mp3), and i didn't found one.

Now i am Studying IT and have finished the 1st semester and lerned a little bit about programming in C.

So since i have more than 1000 songs (6000+ Beatmaps) in my Osu! folder and i can't copy and rename them with my hands or even a macro anymore, i decided to make my own Program for that.

First of all, the code is not very good, but it is quite fast and works on 3 different computers i have tested so far. Due to the fact it is written in C, you need just Windows (and Osu!).

I can almost guarantee that it should work on every pc that has Windows 10, if you have windows 7 or something else, let me know if it did work properly though.

First enter the amount of songs you have, or want to copy, they are currently not sorted, so you should just copy all of them.



You can find the amount of songs you have here in the ...\osu!\songs\ folder



Here you enter your Osu! path it must look like this for example
D:\games\osu!
it must end with ...\osu! and no character behind it, and it should be the right path



if you have set the standard path, which is on your C drive and in appdata, you can enter 1 random character and it will set the standard path



If for some weird reason, the .exe doesn't want to start, you can just drag the Osu mp3 extractor.exe into your CMD and hit enter. One friend of mine had this issue, but also has very bugged Windows, so it should run on any PC.

https://i.imgur.com/CvEbi7C.png


Then all your songs will be copied into a folder called Osu_songs on your Desktop, you can't change that now, probably in the future, when i have time for it, or people want it.

Depending on whether you copy 100 or 3000 songs and if you have a fast NVME SSD or a old laptop HDD it can take from a few seconds to a lot of minutes.

Again i apologize for the ugly look and the bad written code (you probably don't want too see it though).

You don't have to worry about this program to corrupt your beatmaps or osu in any way, because it basically can't do that, because it just copies files to a folder on your desktop.

If more weebs are interested in that, i will probably do a normal user interface and maybe a sorting function, who knows.

DL link here --> https://drive.google.com/open?id=1VS9arLV39KP_hJGYGSpml8GsOOON9ybS
posted
it wouldnt delete the beatmaps right? (sorry for my good english :kappa:)
posted

Fikstorm wrote:

it wouldnt delete the beatmaps right? (sorry for my good english :kappa:)
Thats right, it does not have any delete functions in it, just copy functions. i can guarantee its 100% safe.
posted
looks really interesting, totally downloading it when im going to make my osu playlist :)
posted
I liked the program if it renames the songs automatically, but if not, maybe it's a little useless since you can do this with windows itself without having to open each folder, and I personally have many maps and I don't really like all their songs... Take it as an idea, like an option to just copy the songs of a certain collection.
posted

Mr Sonic wrote:

it's a little useless since you can do this with windows itself without having to open each folder
That does work but, often at half of all maps, the .mp3 is just called "audio.mp3" (for example in the picture you linked "04.mp3") or something else but does often not have the actual name in it. If you have less then a few hundred songs you could probably rename them all by hand with shortcuts, but in my case i have more than 1500 songs so that would take a while.

Mr Sonic wrote:

Take it as an idea, like an option to just copy the songs of a certain collection.
Damn, i completely forgot that collections even exist. I personally don't use them, because i'm usually too lazy to put them in there, but you're right, that would be a lot easier and better, than copying all songs. The only problem is that reading out the collection.db file isn't that easy (for me at least). But i will look into that, might take a few days or weeks.
posted
Awesome job and also a great way to improve programming skills.

As doing this by myself and putting it into my osu!player I can give you probably some feedback.
Sadly I don't know that much of C or the Syntax.

First, why enter the total number of songs in the folder? The programm could do that for you by iterating over the songs folder and count the folders, or use a method from C if there is one like in C#.

gameskill123 wrote:

Damn, i completely forgot that collections even exist. I personally don't use them, because i'm usually too lazy to put them in there, but you're right, that would be a lot easier and better, than copying all songs. The only problem is that reading out the collection.db file isn't that easy (for me at least). But i will look into that, might take a few days or weeks.
Second, I can totally agree with you, reading the collection.db is quite hard and I didn't managed it to do it myself too.

Again nice job and happy coding if you improve it!
posted

- Founntain - wrote:

The programm could do that for you by iterating over the songs folder
You are right, i tried that, but it is insanely difficult with just C. There are headerfiles for doing that, but these do only work in Linux. It would be a lot easier when done in C++, but that would be too much for now. I will definitely find a way to get the count of songs soon.


- Founntain - wrote:

reading the collection.db is quite hard
I did a little bit more research in that and found out, that this is not impossible. You just have to look at the file with a Hex editor and understand how the maps are saved.
Osu generates a md5 sum of the beatmap and is putting that string in the collection.db file.
So you just have to search for each md5 sum in your osu folder (you have to generate them first probably) and can then find the actual song then.

That wouldn't be that difficult in C, because you can easily open files binary and work you way through that.

That said, i just have to understand how to generate md5 sums in C and how to
efficiently search strings within strings.
posted

gameskill123 wrote:

You are right, i tried that, but it is insanely difficult with just C. There are headerfiles for doing that, but these do only work in Linux. It would be a lot easier when done in C++, but that would be too much for now. I will definitely find a way to get the count of songs soon.
Wow never thought that would be that hard to do it in C only. Yeah on C++ there its a quite easier, tried that myself.

gameskill123 wrote:

I did a little bit more research in that and found out, that this is not impossible. You just have to look at the file with a Hex editor and understand how the maps are saved.
Osu generates a md5 sum of the beatmap and is putting that string in the collection.db file.
So you just have to search for each md5 sum in your osu folder (you have to generate them first probably) and can then find the actual song then.
There is a Wiki article to find out what the meaning is in the collection.db. I also should look into how to successfully extract the songs of the collection.db this could be usefull and also a good learning project with hashes and stuff.
posted

gameskill123 wrote:

You are right, i tried that, but it is insanely difficult with just C. There are headerfiles for doing that, but these do only work in Linux. It would be a lot easier when done in C++, but that would be too much for now. I will definitely find a way to get the count of songs soon.
You may be talking about dirent, actually someone converted it to windows: Link
posted

Mr Sonic wrote:

You may be talking about dirent, actually someone converted it to windows: Link
Thx alot for that, but i think i'll just read out the osu.db file. it has basically all information about the beatmaps and the md5 sums of it aswell the following picture shows the amount of folders in Osu!\Songs\

Please sign in to reply.