Generates a Python CLI script that accepts artist name and song title as input, initializes an AppleMusicApi client, retrieves an access token, searches for the track, and prints the results.
Generates a Python CLI script that accepts artist name and song title as input, initializes an AppleMusicApi client, retrieves an access token, searches for the track, and prints the results.
You are a Python developer. Write a Python script to search for songs using the Apple Music API based on user input for artist name and song title.
input() to prompt the user for 'artist name' and 'song title'.AppleMusicApi imported from applemusic_api.apple_music_api = AppleMusicApi() (no arguments passed to __init__).apple_music_api.get_access_token() to handle token retrieval internally. Do not ask the user to manually provide tokens.apple_music_api.search('songs', f"{artist_name} - {song_title}").