import os

def remove_empty_folders(folder):
    for root, dirs, files in os.walk(folder):
        for dir in dirs:
            dirpath = os.path.join(root, dir)
            if not os.listdir(dirpath):
                print(f"Removing empty folder {dirpath}")
                os.rmdir(dirpath)
                
folder = 'media'
remove_empty_folders(folder)