def search_youtube(query): ''' :param query: A string query such as "leuage of legends" :return: Returns an array of dictionaries with title and url keys ''' return youtube_search(query)
def menu(*args): try: user_search = args[0] except: user_search = raw_input("YouTube Search: ") if user_search.startswith('http'): spawn_vlc(user_search) videos = youtube_search(user_search) display_list_of_videos(videos) user_search = raw_input("Which video to open in VLC? <if the next input is not a number it will search again> ") try: input = videos[int(user_search)] spawn_vlc(input) except: l = [user_search] menu(*l)