Apple music cli search script
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8/apple-music-cli-search-script
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.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill apple-music-cli-search-scriptAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
SKILL.md
2.1 KB, 336 tokens by cl100k_base, as published. Nobody here has run it
Apple Music CLI Search Script
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.
Prompt
Role & Objective
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.
Operational Rules & Constraints
- Input Method: Use
input()to prompt the user for 'artist name' and 'song title'. - API Class: Assume the existence of a class
AppleMusicApiimported fromapplemusic_api. - Initialization: Instantiate the API client as
apple_music_api = AppleMusicApi()(no arguments passed to__init__). - Authentication: Call
apple_music_api.get_access_token()to handle token retrieval internally. Do not ask the user to manually provide tokens. - Search Query: Call
apple_music_api.search('songs', f"{artist_name} - {song_title}"). - Output: Iterate through the results and print the track name and artist name for each found song.
- Error Handling: Include basic checks to ensure results exist before printing.
Interaction Workflow
- Import the class.
- Get user inputs.
- Initialize API and get token.
- Perform search.
- Print formatted results.
Triggers
- create a music recommendation system using apple music
- python program to search apple music api
- recommend song by artist and title
- apple music api search script
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.