diff options
author | cira0100 <40918547+cira0100@users.noreply.github.com> | 2020-05-18 02:22:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-18 02:22:42 +0200 |
commit | dc2481d5b7091da8f206ff6b9b0953842d170822 (patch) | |
tree | 8315d920c052c3021bfd6e7c39eeeec7868c1874 | |
parent | 5b5edcae4a73a39acd5ebad1f7a823dee3d41cbf (diff) |
Add files via upload
-rw-r--r-- | OsuSongParser.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/OsuSongParser.py b/OsuSongParser.py new file mode 100644 index 0000000..7e38a9c --- /dev/null +++ b/OsuSongParser.py @@ -0,0 +1,26 @@ +import re +import os +import shutil +regexComp=re.compile(r'^[0-9]*') +regexMp3=re.compile(r'\.mp3$') +cwd = os.getcwd() +sum=0 +s=input("type path to Osu Songs \n") +for filename in os.listdir(s): + sum=sum+1 +for filename in os.listdir(s): + test=regexComp.search(filename) + songName=filename[len(test.group(0))+1:] + path=os.path.join(s,filename) + sum=sum-1 + print("Files left ........ "+str(sum)) + for name in os.listdir(path): + if(regexMp3.search(name)): + shutil.copy(os.path.join(path,name),cwd) + os.rename(os.path.join(cwd,name),os.path.join(cwd,songName)) + break + +print("Done") + + + |