SPAlbumBrowse - 获取艺术家专辑的准确列表
Posted
技术标签:
【中文标题】SPAlbumBrowse - 获取艺术家专辑的准确列表【英文标题】:SPAlbumBrowse - Getting an Accurate List Of An Artist's Albums 【发布时间】:2013-10-03 07:48:53 【问题描述】:好的。这越来越疯狂了。我已经为此工作了几天,尝试了不同的奇怪事情。我想我昨晚做了一个关于 libSpotify 的噩梦,可能是我睡眠习惯的产物,但是,我跑题了。
无论如何。让我们使用以下代码查找艺术家“The XX”。假设 artist 被初始化为艺术家“the xx”,Spotify url spotify:artist:3iOvXCl6edW5Um0fXEBRXy
artistBrowse = [[SPArtistBrowse alloc] initWithArtist: artist inSession: spotifySession type: SP_ARTISTBROWSE_ALBUMS];
[SPAsyncLoading waitUntilLoaded: artistBrowse timeout: kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems)
[SPAsyncLoading waitUntilLoaded: artistBrowse.albums timeout: kSPAsyncLoadingDefaultTimeout then:^(NSArray *loadedItems, NSArray *notLoadedItems)
NSArray *types = @[@"a", @"s", @"c", @"u"];
for(SPAlbum *album in loadedItems)
NSLog(@"%@, %@, %@, %d, %-50s, %@", types[album.type], album.available ? @"Y" : @" N", album.artist.name, album.year, album.name.UTF8String, album.spotifyURL);
];
];
这是输出。抱歉,有点长。请注意,第一列是指专辑的 SP_ALBUM_TYPE(a = 专辑,s = 单曲,c = 合辑,u = 未知),第二列是 Y 或 N,具体取决于专辑是否在我的会话所在区域可用( US),第三列是艺术家姓名,第五列是专辑年份,第六列是专辑名称,最后是专辑的 Spotify URL。
u, N, The xx , 2012, Coexist , spotify:album:2cRMVS71c49Pf5SnIlJX3U
u, N, The xx , 2009, xx , spotify:album:2rmMeEq5D1Bg7YFRwtHBDr
a, N, The xx , 2009, xx , spotify:album:2nXJkqkS1tIKIyhBcFMmwz
s, Y, The xx , 2013, Reunion (Edu Imbernon Remix) , spotify:album:4GRHNZJ1dWCqgWfiyyJF2L
u, N, The xx , 2013, Fiction , spotify:album:4fUxANSrGWQlRtF2kpxo6g
s, Y, The xx , 2013, Innervisions Remixes , spotify:album:4ZmviA6XFr2D2Bfw0bicwa
s, Y, The xx , 2013, Sunset (Jamie Jones Remix) , spotify:album:1XlsTZcDbHQmLr3tNvuV5o
s, Y, The xx , 2013, Sunset (Kim Ann Foxman Remix) , spotify:album:26gAjcYx9iGrOuplES6jC1
s, Y, The xx , 2012, Angels , spotify:album:7kuu8alOjlFTGJmwsRINz9
s, Y, The xx , 2012, Angels (Four Tet Remix) , spotify:album:4ZLWktgv4GJSgzzskz6rpI
s, Y, The xx , 2012, Chained (John Talabot and Pional Blinded Remix) , spotify:album:2PsFbWSt7nAwZuO6M6zeMU
s, Y, The xx , 2012, Chained (LIAR Remix) , spotify:album:6HrD4wpVXVfXkZP1gxcKyH
s, Y, The xx , 2012, Jamie xx Edits , spotify:album:33UOrxCqUHQDH3XvNEYWoP
s, N, The xx , 2009, Basic Space , spotify:album:0LusnqOZqR8IYXHWE3DSQI
s, N, The xx , 2009, Basic Space , spotify:album:6aStvQrltK28rgDFsyOsBS
s, Y, The xx , 2009, Crystalised , spotify:album:6npsIAD3tolsM1htkmCDpT
s, N, The xx , 2009, Islands , spotify:album:7rW7Zf8fTJT25wMo4z6ww3
s, N, The xx , 2009, Islands , spotify:album:0KVBiUIqhl087FgJyvr8kS
s, N, The xx , 2009, VCR , spotify:album:0eRJD5ey3HqIgsGheUwZqg
s, Y, The xx , 2009, VCR (Four Tet Remix) , spotify:album:0L1Dg07wMBxRkzO5qlN1li
s, N, The xx , 2009, xx , spotify:album:0z6ErTRiEcAML2IPrkWI5W
a, N, Various Artists , 2013, Circus HalliGalli , spotify:album:0SCDZwyv5MbWsCdmeRHJUb
a, N, Craig Armstrong , 2013, The Orchestral Score From Baz Luhrmann's Film The Great Gatsby, spotify:album:7hTAlVO7LPTI5Q3KI5rTkR
a, Y, Craig Armstrong , 2013, The Orchestral Score From Baz Luhrmann's Film The Great Gatsby, spotify:album:6OuywehyzlNMYklKnPpr1W
a, N, Various Artists , 2013, Ministry Of Sound Chillout Sessions Classics , spotify:album:4yfIS04c7NLu20GEx0fKLm
a, N, Various Artists , 2013, Young Folks , spotify:album:56HMwAOWW0jnAH7J1S71Q1
a, N, Various Artists , 2013, Dance Anthems (Summer Edition 2013) , spotify:album:25uYDaqMIFjCSKKWgDpDuM
a, N, Various Artists , 2013, FluxFM - Popkultur kompakt Vol. 1 , spotify:album:44OoPqLioRdPtG181OSWXO
a, Y, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:0ke0VwcET1D6neauEyk4U4
a, Y, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:1ApOUkhympslVqgf9QFHUj
a, Y, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:4fPvaODSSdvvP7nuVKCYW2
a, N, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:0WXuzb6XoO21qOswVOH0xG
a, N, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:2XVXltseIMrGuK09ck7TpS
a, N, Various Artists , 2013, Music From Baz Luhrmann's Film The Great Gatsby , spotify:album:4zmVotzGvedZLgLt7b9enu
a, N, Various Artists , 2013, De Afrekening 54 , spotify:album:5v4Mk83IAaZF8v2ZJlR3zJ
a, N, Various Artists , 2013, Ministry of Sound FUT.UR.ISM , spotify:album:2oliIwXGnek066NvzFOyMh
a, N, Various Artists , 2013, Dermot O'Leary Presents The Saturday Sessions 2013, spotify:album:0vxrNQhxXzFHDoDe8ujfmC
a, N, Various Artists , 2013, Dermot O'Leary Presents The Saturday Sessions 2013, spotify:album:4IjdYP8ejVAUVhYEHIxV69
a, N, Various Artists , 2013, Switch 21 , spotify:album:2asHAel3cC4en0vj8OvL14
a, N, Various Artists , 2013, BRIT Awards 2013 , spotify:album:42DRlqFzejkEI1wTjggazF
a, N, Various Artists , 2013, about:berlin vol:2 , spotify:album:2M4eESAbUIRLtcoTZWKSwd
a, N, Various Artists , 2012, De Afrekening 53 - Best Of 2012 , spotify:album:3EZr5R7qYv49m80jTjjURV
a, N, Various Artists , 2012, Thank God It's Friday , spotify:album:0uUKY9EW6pQN8SPzU9vUyd
a, N, Various Artists , 2012, Humo 2012 , spotify:album:3JUslyKt2lAhaQdwX2nsCu
a, N, Various Artists , 2012, FM4 Soundselection Vol.27 , spotify:album:6vWWIRMgDoy3bYkX6oYy6j
a, N, Various Artists , 2012, Ministry of Sound Chillout Sessions XV , spotify:album:1luLiZ8M8yvlwwaLZNkBxI
a, N, Various Artists , 2012, Life Is Music 2012/2 , spotify:album:5uobOKU5V5Gdkr89uioVSk
a, N, Various Artists , 2012, Pure FM Vol.3 - Best Of 2012 , spotify:album:6VZUAizoJYpXS614EhuErD
a, N, Various Artists , 2012, Festivalitis , spotify:album:1Wzv0KyuSgZhXJTVSHuZMR
a, N, Various Artists , 2012, Sonar 1000 Vol.2 , spotify:album:6RygdphSUzqmQI0tY0XTC8
a, N, Various Artists , 2012, We Love Real Music , spotify:album:3YTlHLpLTpAPYzkh05iewe
a, N, Various Artists , 2012, Alle 40 Goed: Alternative , spotify:album:2v7n6Lgf0IV3bWqsxczFYO
a, N, Various Artists , 2012, Alle 40 Goed: Alternative , spotify:album:3Xy2qnFEUNjHMXAF3AlHhD
a, N, The Antlers , 2011, Together , spotify:album:5k6JBXhKxclnxOtGtvpxXP
a, N, Various Artists , 2011, Radio 1 Sonar 1000 , spotify:album:0ZiepVOAQGrWIl7AeUUsEy
a, N, Various Artists , 2011, Ministry of Sound Uncovered 3 , spotify:album:31Ut6kXlaSoADr5k52rYQb
a, N, Various Artists , 2011, The Weather Channel Presents – The Sounds Of Winter, spotify:album:3TWTfxuFaMCcQMHomKRTpN
a, N, Various Artists , 2011, Solid Sounds 2011/1 , spotify:album:46lwy99LsDyubeZU2KK5kB
a, N, Various Artists , 2010, Humo's Top 2010 , spotify:album:6Cvt2RPh9ANl4CUMXGSFHu
a, N, Various Artists , 2010, Ministry Of Sound Chillout Sessions XIII , spotify:album:2ze7hxcYnwo4CpdyK63xGQ
a, Y, The Big Pink , 2010, Tapes , spotify:album:1RW3Hq6dTHn1Phur2dRvg3
c, Y, The Big Pink , 2010, Tapes , spotify:album:2GJplTNzOUot6it93FtfLu
a, N, Mario Basanov , 2010, Future Balearica: New Chill & Warm Sunset Sounds , spotify:album:0I3COq9K4saT03qXsCmq6c
a, N, Various Artists , 2010, Volume.at - Alternative Summer 2010 , spotify:album:5juF4xi88AVJCreQCdm319
a, N, Various Artists , 2010, Festivalguide 2010 , spotify:album:3B066qff9ZcbFuFWC4vYai
a, N, Various Artists , 2010, Life Is Music 2010-1 , spotify:album:2jsGbNXBbjI933cmL9kGms
a, N, Various Artists , 2010, Uncovered 2 , spotify:album:3TEnNtbEnahNSkmcp0xQFZ
a, N, Various Artists , 2010, Various Artists/Rough Trade Counter Culture 09 , spotify:album:0KRR3PXLfJlIccrlgAllBh
从这些数据中,我想提取如下内容。这些是 xx 在他们的艺术家页面上的专辑,官方 Spotify 桌面客户端与我用来登录 libSpotify 的帐户相同。
请注意,在输出中,即使我从 artistBrowse.albums 加载了所有专辑,我所在地区实际可用专辑的两项全部都列为不可用,并且只有一个实际上被列为专辑。
u, N, The xx , 2012, Coexist , spotify:album:2cRMVS71c49Pf5SnIlJX3U
u, N, The xx , 2009, xx , spotify:album:2rmMeEq5D1Bg7YFRwtHBDr
a, N, The xx , 2009, xx , spotify:album:2nXJkqkS1tIKIyhBcFMmwz
我该如何解决这个问题?很多时候,如果您使用专辑的 Spotify URL 检查 web-api,通过专辑.available 说它们在我所在的地区不可用,“美国”地区代码就在专辑结果页面的输出中来自网络 API。其次,我总是得到截然不同的结果。没有什么是一致的,有时 Red Hot Chili Peppers 的专辑“I'm With You”在我所在的地区显示为可用,有时在我所在的地区没有可用的专辑。如果有我所在地区不可用的专辑,有时会调用另一个 waitUntiLoaded: 调用,并在使用 ArtistBrowse 的 waitUntilLoaded 调用中返回 loadedItems。相册解决了这个问题;偶尔再次加载“加载的项目”可以缓解问题?这甚至没有意义。
最后,wtf。
a, N, Rihanna , 2012, Unaplogetic , spotify:album:4owyFvp5H3UXKIOBBT9x3m
a, Y, Rihanna , 2012, Unapologetic , spotify:album:0XJya16l3K1J2dEwY19F8z
a, Y, Rihanna , 2012, Unapologetic , spotify:album:4eddbruVtOqw8khwxSH6H2
a, N, Rihanna , 2012, Unapologetic , spotify:album:4XBfFj0WYyh5mBtU61EdyY
a, N, Rihanna , 2012, Unapologetic , spotify:album:5pLlGJrxuQO3jMoQe1XxZY
a, N, Rihanna , 2012, Unapologetic , spotify:album:0giyQojM6DkyXVYigNo72p
a, Y, Rihanna , 2012, Unapologetic , spotify:album:1ciAVKFdlpLi2eGDlXv6Bo
a, N, Rihanna , 2012, Unapologetic , spotify:album:1jlYso6n0IxsGTLIvZOXUn
a, N, Rihanna , 2012, Unapologetic , spotify:album:5UDXzVwWnn3mDy3mTpQPYb
HELP拜托,这是一个巨大的无赖。对于如何获得任何类可靠的列表,我确实完全不知所措,尽管我相信如果官方客户可以做到,那么我也可以。我已经盯着这个看了很多天了,我正在考虑通过调用 web-api 来备份我的搜索,比如,使用 web-api 为我提供艺术家的专辑列表......听起来真的很不愉快尽管。否则,与图书馆合作非常愉快。再次感谢您的帮助!
【问题讨论】:
【参考方案1】:这个问题可能是因为有相同的专辑,但在不同的区域。我假设桌面客户端排序是基于区域的列表中。 P>
您可能需要检查用于available
属性内SPArtistBrowse
P>
【讨论】:
以上是关于SPAlbumBrowse - 获取艺术家专辑的准确列表的主要内容,如果未能解决你的问题,请参考以下文章
无法在 Spotify Apps API 中获取艺术家的专辑
使用 Spotify 中 sp.albums 的 .json 输出从同一艺术家的多个专辑中获取曲目 ID