forum

Program, that saves all your Osu! songs in one folder as .mp3 files

posted
Total Posts
18
Topic Starter
chokonmainatsu
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



Troubleshoot, if it does not want to start
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
greyicecream
it wouldnt delete the beatmaps right? (sorry for my good english :kappa:)
Topic Starter
chokonmainatsu

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.
Iko
.
Mr Sonic
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.
Topic Starter
chokonmainatsu

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.
Founntain
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!
Topic Starter
chokonmainatsu

- 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.
Founntain

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.
Mr Sonic

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
Topic Starter
chokonmainatsu

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\

corneel
this is the first program that actually copied all songs for me but they are all just 1 byte large and i can't play them, is there any work around?
Topic Starter
chokonmainatsu

corneel wrote:

this is the first program that actually copied all songs for me but they are all just 1 byte large and i can't play them, is there any work around?
I made this quite long ago, so the code is garbage, maybe i should rewrite it someday. Are you on Windows 10?
- Isla -
that sounds amazing.
corneel

gameskill123 wrote:

corneel wrote:

this is the first program that actually copied all songs for me but they are all just 1 byte large and i can't play them, is there any work around?
I made this quite long ago, so the code is garbage, maybe i should rewrite it someday. Are you on Windows 10?
sorry for the late response, i did manage to find a program that did the job and i'm able to listen to all the songs now.
sorry for necroing your post.
yes i'm on windows 10 right now.
oSumAtrIX

gameskill123 wrote:

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\

You can view the database with any database reader or use a premade library as reference.

Wouldn't it be possible to just use the currently iterated and formatted foldername as the name of the song? Alternatively you can also read the .osu files for the song and author names.
Topic Starter
chokonmainatsu

oSumAtrIX wrote:

You can view the database with any database reader or use a premade library as reference.
I don't know how it'd be possible to read the .db with a database reader, as it doesn't know in which order stuff is stored. Coincidentally i made a osu!.db parser myself last night in Qt5 C++.

oSumAtrIX wrote:

Wouldn't it be possible to just use the currently iterated and formatted foldername as the name of the song? Alternatively you can also read the .osu files for the song and author names.
That is very true, the osu!.db contains the folder name as well as the name of the .mp3 file, but at that time (1.5 years ago) i didn't know any better. I could only do a little bit of C and just searched all .mp3 files and named them to their parent directory. I did the copying by literally constructing a "copy" command for the windows CMD and passed that to the CMD.

Until today i've gotten a lot better at coding especially in C++ and object oriented programming, the next time i would do it a lot better.

If anyone is still interested in this i may be doing some kind of maps/songs manager in the future, i just don't have any good ideas on what features to do/implement.

reading the osu!.db file was a pain in the a**, but a lot easier this time, last time i gave up pretty quickly.
corneel
Maybe add a option that puts the collection into different maps.
Or make a option that only downloads 1 collection instead of all.
An option that puts the map background as the album picture of the song to it, for those that remember songs by the background.
A option to maybe download the songs from a certain star rating?
Please sign in to reply.

New reply