def get_artist_tracks(username, artist, title): if TRACK_SEPARATOR in artist: (artist, title) = split_artist_track(artist) print("Searching Last.fm library...\r",) try: tracks = lastfm_network.get_user( username).get_artist_tracks(artist=artist) except Exception as e: sys.exit("Exception: " + str(e)) total = 0 print("\t\t\t\t\r"), # clear line if title is None: # print all for track in tracks: print_track(track) total = len(tracks) else: # print matching titles find_track = pylast.Track(artist, title, lastfm_network) for track in tracks: if str(track.track).lower() == str(find_track).lower(): print_track(track) total += 1 print("Total:", total) return total
def get_artist_tracks(username, artist, title): if TRACK_SEPARATOR in artist: (artist, title) = split_artist_track(artist) print("Searching Last.fm library...\r") try: tracks = lastfm_network.get_user(username).get_artist_tracks( artist=artist) except Exception as e: sys.exit("Exception: " + str(e)) total = 0 print("\t\t\t\t\r"), # clear line if title is None: # print all for track in tracks: print_track(track) total = len(tracks) else: # print matching titles find_track = pylast.Track(artist, title, lastfm_network) for track in tracks: if str(track.track).lower() == str(find_track).lower(): print_track(track) total += 1 print("Total:", total) return total
def thing(): init() station = media_player_now_playing() print(station) if station is None: return skip = lastfm_now_playing(station) print_track(skip) media_player_stop() while(True): try: time.sleep(5) now = lastfm_now_playing(station) print(".", end="") if now != skip: print() print_track(now) break except: break media_player_play()
def thing(): init() station = media_player_now_playing() print(station) if station is None: return skip = lastfm_now_playing(station) print_track(skip) media_player_stop() while (True): try: time.sleep(5) now = lastfm_now_playing(station) print(".", end="") if now != skip: print() print_track(now) break except: break media_player_play()
def get_recent_tracks(username, number): recent_tracks = lastfm_network.get_user( username).get_recent_tracks(limit=number) for track in recent_tracks: print_track(track) return recent_tracks
def get_recent_tracks(username, number): recent_tracks = lastfm_network.get_user(username).get_recent_tracks( limit=number) for track in recent_tracks: print_track(track) return recent_tracks