def __init__(self): key_id = os.getenv("APPLE_KEY_ID") team_id = os.getenv("APPLE_TEAM_ID") secret_key = os.getenv("APPLE_SECRET_KEY") super().__init__( applemusicpy.AppleMusic(secret_key=secret_key, key_id=key_id, team_id=team_id))
def __init__(self, id=None): """Initialize an AppleMusic object.""" self.key_id = 'UL5GUU9TUZ' self.team_id = '564AWN3BL5' # Need to replace this when it goes on to a real hosting site with open('/Users/nickpanagakis/Desktop/Music-Project/music_converter/converter/AuthKey_UL5GUU9TUZ.p8', 'r') as key_file: self.secret_key = key_file.read() self.apple_music = applemusicpy.AppleMusic(self.secret_key, self.key_id, self.team_id) self.id = id self.playlist_info = []
import applemusicpy #for privacy not including keys secret_key = 'x' key_id = 'y' team_id = 'z' am = applemusicpy.AppleMusic(secret_key=secret_key, key_id=key_id, team_id=team_id) def pl_fetch(): pl_list = [] #user must specify playlists they want to migrate return_list = am.playlists(pl_list) return return_list def song_fetch(): playlists = pl_fetch() song_list = [] song_list.append(x) return song_list results = am.search('travis scott', types=['albums'], limit=5) for item in results['results']['albums']['data']: print(item['attributes']['name'])