我是python的初学者,正在尝试解析以下JSON。我不知道怎么弄到这首歌的艺术家名字和标题。在{
"status": {
"msg": "Success",
"code": 0,
"version": "1.0"
},
"metadata": {
"music": [
{
"external_ids": {
"isrc": "USSM10603618",
"upc": "888880170897"
},
"play_offset_ms": 8920,
"external_metadata": {
"spotify": {
"album": {
"id": "0JLv6iVbeiy4Dh2eIw6FKI"
},
"artists": [
{
"id": "6vWDO969PvNqNYHIOW5v0m"
}
],
"track": {
"id": "3qSMg1lhn4jDwWlI9xCVyK"
}
},
"itunes": {
"album": {
"id": 464320979
},
"artists": [
{
"id": 1419227
}
],
"track": {
"id": 464321089
}
},
"deezer": {
"album": {
"id": 72429
},
"artists": [
{
"id": 145
}
],
"genres": [
{
"id": 132
}
],
"track": {
"id": 551232
}
}
},
"title": "Listen (From the Motion Picture \"Dreamgirls\")",
"duration_ms": "217786",
"album": {
"name": "B'Day Deluxe Edition"
},
"acrid": "4660601066a3153acf15eabe2868572b",
"genres": [
{
"name": "Pop"
}
],
"artists": [
{
"name": "Beyoncé"
}
]
}
],
"timestamp_utc": "2015-07-27 10:35:28"
},
"result_type": 0
}
我的代码是:
^{pr2}$
我得到以下错误:
列表索引必须是整数而不是str
请帮忙