pLibraryOrganizer - Manage your music library like iTunes does

Published: by

  • Categories:

I made a script to manage my music. By managing, I mean it will sort the files according to the rules you give as a command-line argument.

Project page:-https://github.com/shadyabhi/pLibraryOrganizer

shadyabhi@archlinux ~/github/pLibraryOrganizer $ ./pLibraryOrganizer.py -h
usage: pLibraryOrganizer.py [-h] -f FORMAT -d DIRECTORY [-D FINALDIRECTORY]
                            [-v] [-et EDITTITLE EDITTITLE]
                            [-ea EDITARTIST EDITARTIST]
                            [-eA EDITALBUM EDITALBUM] [-dr]

Organizes your library

optional arguments:
  -h, --help            show this help message and exit
  -f FORMAT, --format FORMAT
                        Enter format for organizing the music
  -d DIRECTORY, --directory DIRECTORY
                        Enter the directory root.
  -D FINALDIRECTORY, --finaldirectory FINALDIRECTORY
                        Directory to finally move the mp3 files too
  -v, --verbose         For more verbose output
  -et EDITTITLE EDITTITLE, --edittitle EDITTITLE EDITTITLE
                        Replace in Title
  -ea EDITARTIST EDITARTIST, --editartist EDITARTIST EDITARTIST
                        Replace in Artist
  -eA EDITALBUM EDITALBUM, --editalbum EDITALBUM EDITALBUM
                        Replace in Album
  -dr, --dryrun         Don't move the files. Just show what you are doing
shadyabhi@archlinux ~/github/pLibraryOrganizer $ 

Usage:-

  • If you want delete all the folders and keep all the mp3 files in root with name %artist% - %title%, execute:

    python2 pLibraryOrganizer.py -f "%artist% - %title%" -d "/home/shadyabhi/music/"

  • Suppose, you want your music sorted such that all the mp3s have name as %artist% - %title% and each artist should have a different folder. Also, in the process you want to remove or replace " - www.Songs.PK" in the titles. [All files downloaded from songs.Pk have that annoying titles]

    python2 pLibraryOrganizer.py -f "%artist%/%artist% - %title%" -d "/home/shadyabhi/music/" -et " - www.Songs.PK" ""

  • If you want your music to move to a new directory, lets say /tmp/music:

    python2 pLibraryOrganizer.py -f "%artist%/%artist% - %title%" -d "/home/shadyabhi/music/" -D "/tmp/music/"

Known issues: If your music directory has files other than *mp3 file, this script will fail to delete that directory. You can remove all files from a directory other than mp3 by using this command (removes all *.jpg files): [ Caution: Run this command from the root of your music directory only. It deletes file recursively starting from the current folder ]

find -type f -name ".jpg" -exec rm -v {} \;

Hope that script will be of use to you. :)