0

The following works and retrurns a list of semmingly random tracks which GraceNote thinks are similar to Bowe's work:

radioPlayList = pygn.createRadio(GRACENOTE_CLIENT_ID, GRACENOTE_USER_ID, artist='Bowie', count='3');

However, I would strongly prefer to pass a genre, rather than an atrist - I just can't figure our how.

This radioPlayList = pygn.createRadio(GRACENOTE_CLIENT_ID, GRACENOTE_USER_ID, genre='38', count='3'); returns <RESPONSES>\n <RESPONSE STATUS="NO_MATCH">\n </RESPONSE>\n</RESPONSES> which lead me to beleive that Genre should not just be a simple number.

And trying to give the genre as a text, radioPlayList = pygn.createRadio(GRACENOTE_CLIENT_ID, GRACENOTE_USER_ID, genre='Oldies', count='3'); gives <RESPONSES>\n <MESSAGE>GCSP: RADIOCREATE error: [8] radio: Invalid attribute seed.</MESSAGE>\n <RESPONSE STATUS="ERROR">\n </RESPONSE>\n</RESPONSES>\n so that is obviously not the way to do it.

QUESTION: how can I pass a Genre (only) and get a radio playlist in return?

The only Pygn docuemntation which I can find does not help. I am hoping that @cweichen will se thsi question & help me. Does anyone else know how?


[Update] Looking in the code of Pygn's test.py, I see

# Example how to create a radio playlist by genre classical music result = pygn.createRadio(clientID, userID, genre='36061', popularity ='1000', similarity = '1000') print(json.dumps(result, sort_keys=True, indent=4))

Question: where do I get a list of those genre values? The file readme.md says genre: a genre ID from the genres below, but here is no list below.

4

1 回答 1

1

要获取流派(或情绪,或时代)列表,您需要调用“fieldvalues”API - 这还没有在 pygn 中,但您可以在此处查看如何执行此操作:

https://developer.gracenote.com/rhythm-api#attribute-station

此调用将为您提供支持的流派列表:

https://cXXXXXXX.web.cddbp.net/webapi/json/1.0/radio/fieldvalues?fieldname=RADIOGENRE&client=CLIENT_ID&user=USER_ID

然后,您可以将返回的 ID 与 pygn.createRadio() 一起使用

于 2014-11-10T22:43:10.393 回答