def execute(self, operand): search_string = operand self.debug("The search string: " + search_string) local_song = song.find_song(search_string) if local_song: self.debug("Found local song!") local_song.play() return #We didn't find it locally; check youtube! vid_id, name = youtube.search_first_hit(search_string) youtube.play_song(vid_id, name) if self.get_config('ASK_DOWNLOAD'): print("Do you want to download this song?") answer = inputs.get_string() if meaning.means(answer, "yes"): youtube.download_song(vid_id)
def execute(self, operand): vid_id, name = youtube.search_first_hit(operand) youtube.play_video(vid_id)