Playlist generator in Python