0

Write a python script for mass renaming music files according to labels. The script takes an existing format of files in
current directory and an expected output format and prints a list of old -> new file name tuples.
Format can be any string that contains any number of the labels: <artist>, <album>, <track>, <year>

Assume file names match input format.

Sample list of input files:

Bob Dylan - 01 You're No Good (1962).mp3
Bob Dylan - 02 Talkin' New York (1962).mp3
Bob Dylan - 03 In My Time of Dyin' (1962).mp3
Bob Dylan - 04 Man of Constant Sorrow (1962).mp3
Bob Dylan - 05 Fixin' to Die (1962).mp3
Bob Dylan - 06 Pretty Peggy-O (1962).mp3
Sample input format:

<album> - <track> <title> (<year>).mp3
Sample output format:

Bob Dylan/<year> <album>/<track> <title>.mp3
Expected output:

Bob Dylan - 01 You're No Good (1962).mp3 -> Bob Dylan/1962 Bob Dylan/01 You're No Good.mp3
Bob Dylan - 02 Talkin' New York (1962).mp3 -> Bob Dylan/1962 Bob Dylan/02 Talkin' New York.mp3
Bob Dylan - 03 In My Time of Dyin' (1962).mp3 -> Bob Dylan/1962 Bob Dylan/03 In My Time of Dyin'.mp3
Bob Dylan - 04 Man of Constant Sorrow (1962).mp3 -> Bob Dylan/1962 Bob Dylan/04 Man of Constant Sorrow.mp3
Bob Dylan - 05 Fixin' to Die (1962).mp3 -> Bob Dylan/1962 Bob Dylan/05 Fixin' to Die.mp3
Bob Dylan - 06 Pretty Peggy-O (1962).mp3 -> Bob Dylan/1962 Bob Dylan/06 Pretty Peggy-O.mp3
Bonus: also rename the files and create required directories along the way

3
Contributors
2
Replies
16
Views
4 Days
Discussion Span
Last Post by pty
2

Here's a better idea: you show us how far you have got with your code, and where you are having problems. Then someone can actually try and help you. Deal?

Votes + Comments
Deal!
1

Beets is exactly this. Don't try to rip it off OP, it'll be painfully obvious.

Votes + Comments
If it's for personal use, a great way to start then customize. If for school, well, a deep one.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.