def choose():
    artists = get_artists_dict()
    artistkey = inputs.get_item_from_list(sorted(artists.keys()))
    artist_path = artists[artistkey]

    songs = get_songs_dict(artist_path)
    songkey = inputs.get_item_from_list(sorted(songs.keys()))
    song_path = songs[songkey]

    song = Song(song_path)
    return song
 def execute(self, operand):
     """
     The master method for the roomtraining script
     @param operand:
     """
     exercise = inputs.get_item_from_list(self.get_config('ROOM_TRAINING_OPTIONS'))
     week = inputs.get_integer_in_range(1, self.get_config('WEEKS_PER_EXERCISE'), prompt="Week: ")
     day = inputs.get_integer_in_range(1, self.get_config('DAYS_PER_WEEK'), prompt="day: ")
     difficulty_level = inputs.get_item_from_list(self.get_config('DIFFICULTY_LEVELS'))
     rest, workout_list = self.get_training_scheme(exercise, week, day, difficulty_level)
     self.debug("scheme= " + str((rest, workout_list)))
     self.coach(exercise, rest, workout_list)
def download_song(vidid):
    download = system.call_silently(
        "youtube-dl --extract-audio --audio-format mp3 --id http://youtube.com/watch?v=" + vidid, sync=False
    )

    print("Please fill in some info: ")
    artist = inputs.get_string(prompt="Artist: ")
    album = inputs.get_string(prompt="Album: ")
    title = inputs.get_string(prompt="Title: ")

    # heel lelijk, moet veranderd worden
    musicdir = song.get_music_dirs()[0]
    if len(song.get_music_dirs()) > 1:
        musicdir = inputs.get_item_from_list(music_conf.MUSIC_DIRS)

    if not os.path.isdir(musicdir + "/" + artist):
        os.mkdir(musicdir + "/" + artist)
    if not os.path.isdir(musicdir + "/" + artist + "/" + album):
        os.mkdir(musicdir + "/" + artist + "/" + album)

    download.wait()

    file_path = musicdir + "/" + artist + "/" + album + "/" + title + ".mp3"
    os.rename(vidid + ".mp3", file_path)

    audio = EasyID3(file_path)
    audio["title"] = title
    audio["artist"] = artist
    audio["album"] = album
    audio.save()