All pastes #103998 Raw Edit

Something

public text v1 · immutable
#103998 ·published 2006-07-28 15:28 UTC
rendered paste body
from ID3 import *
import os
import glob

#some configuration options
remove_existing = 0 #remove directory if already exists. Not currently supported
album_subfolder = 1 #create subfolders inside ARTIST for each ALBUM

#tmp [removed from build]
extension = 'mp3' #filetype to sort
dire = 'D:/My Music/'

def getfiles():
    listr = glob.glob(dire + '*' + extension)
    return listr


def sort(songlist):
    final = len(songlist)

    i = 0
    while i < final:
        id3info = ID3(songlist[i])
        print id3info['ARTIST']

        i = i + 1


mylist = getfiles()
sort(mylist)