def run(self): """ Runs every function at the right time: 1) Gets songs interactively/from a file 2) Downloads the songs 3) Tags the metadata 4) Renames the songs paths to human-convenient paths. 5) Uploads the songs to wetransfer if the option was chosen 6) Prints songs availability 7) Removes deemix config folders """ if self.file_path: self.get_songs_file() elif self.all_album: self.get_songs_album() elif self.link: self.get_songs_link() else: self.get_songs_interactive() newline() self.list_songs() if self.to_check: self.offer_fix() newline() self.download() newline() self.tag() self.rename() if self.to_upload: self.upload() newline() self.show_availability() newline() self.finish()
def get_songs_album(self): album = None while not album: newline() album_name = input( "--> Enter album name (+ Artist), or Return-key to continue: ") album = AMFunctions.search_album(album_name) self._add_songs(album)
def show_availability(self): """ Prints places the downloaded songs are available. - Always prints the local path - Will only print wetransfer path if chosen to upload """ print( f"--> Your download is available at:\n{realpath(self.download_path)}" ) if self.to_upload: newline() print(f"--> Your download is available at:\n{self.wt_link}")
def get_songs_interactive(self): """ This function interactively asks user for input for each song until the user decides to stop adding songs, and adds them. """ to_continue = True while to_continue: newline() song_name = input( "--> Enter song name (+ Artist), or Return-key to continue: ") if not song_name: to_continue = False continue found_song = self._search_song(song_name) if found_song: print(f"--> {found_song}")
def download_songs(self, songs: Iterable[AMSong], upload=False): self._add_songs(songs) self.list_songs() newline() self.download() newline() self.tag() self.rename() if upload: self.upload() newline() self.show_availability() newline() self.finish()