def format_track(track, show_url=True):
 out = track['title']
 out += ' by \x02{}\x02'.format(track['user']['username'])
 if track['genre']:
  out += ' - \x02{}\x02'.format(track['genre'])
 out += ' - \x02{:,}\x02 plays, \x02{:,}\x02 favorites, \x02{:,}\x02 comments'.format(track['playback_count'], track['favoritings_count'], track['comment_count'])
 if show_url:
  out += ' - {}'.format(web.try_shorten(track['permalink_url']))
 return out

def format_track ( track , show_url = True ) : out = track [ 'title' ] out += ' by \x02{}\x02' . format ( track [ 'user' ] [ 'username' ] ) if track [ 'genre' ] : out += ' - \x02{}\x02' . format ( track [ 'genre' ] ) out += ' - \x02{:,}\x02 plays, \x02{:,}\x02 favorites, \x02{:,}\x02 comments' . format ( track [ 'playback_count' ] , track [ 'favoritings_count' ] , track [ 'comment_count' ] ) if show_url : out += ' - {}' . format ( web . try_shorten ( track [ 'permalink_url' ] ) ) return out
takes a soundcloud track item and returns a formatted string .