musicbrainz api 获取所有发布组和发布日期 [英] musicbrainz api get all release groups and release dates

查看:21
本文介绍了musicbrainz api 获取所有发布组和发布日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 musicbrainz api 在一次通话中获得一位艺术家的所有发行组和发行日期?我最接近这样做的是使用:

How do I get ALL release groups and release dates for an artist in one call with the musicbrainz api? The closest I've been able to come to doing this is by using:

http://musicbrainz.org/ws/2/release-group?query=arid:494e8d09-f85b-4543-892f-a5096aed1cd4&fmt=json

但是,一些发布组不在那里.例如,使用上面的调用,EP"、Single + Remix"和一些非官方版本都没有出现.基本上,我希望能够生成与musicbrainz 生成的列表相同的列表,当您转到所有"版本的艺术家主页时:

However, some of the release groups are not there. For example, using the above call, the "EP", "Single + Remix" and some of the unofficial releases are not showing up. Basically, I'd like to be able to produce the same list that musicbrainz produces when you go to an artist's main page for "all" releases:

https://musicbrainz.org/artist/494e8d09-f85b-4543-892f-a5096aed1cd4?all=1

此外,上面的 api 调用不会返回发布日期.有什么建议?这些是bug吗?在哪里报告它的最佳位置?

Also, the api call above doesn't return release dates. Any suggestions? Are these bugs? Where would be the best place to report it?

推荐答案

你可以做的第一件事就是不要使用搜索 API,它有点不灵活(它不支持 inc 参数),但如果您已经知道艺术家的 MBID,您可以简单地使用 浏览请求:https://musicbrainz.org/ws/2/release?artist=494e8d09-f85b-4543-892f-a5096aed1cd4&fmt=json&inc=release-groups.

The first thing you can do is not use the search API, which is somewhat inflexible (it doesn't support inc parameters), but if you already know the MBID of the artist, you can simply use a browse request: https://musicbrainz.org/ws/2/release?artist=494e8d09-f85b-4543-892f-a5096aed1cd4&fmt=json&inc=release-groups.

使用 inc=release-group 参数,您还请求所有版本的发布组信息(您也可以请求其他信息,请查看 文档).

With the inc=release-group parameter, you're requesting release group information for all the releases as well (you can request other information as well, check the documentation).

您还会注意到,虽然 JSON 文档说 "release-count": 317,但它实际上并未包括所有这些.这是因为浏览请求支持分页.要获得所有版本,您可以增加限制(通过添加 limit=100)然后执行 3 个额外请求(offset=100, offset=200code> 和最后 offset=300).因此,您的最后一个请求是 https://musicbrainz.org/ws/2/release?artist=494e8d09-f85b-4543-892f-a5096aed1cd4&fmt=json&inc=release-groups&limit=100&偏移=300

What you'll also notice is that, although the JSON document says "release-count": 317, it does not actually include all of them. This is because browse requests support pagination. To get all releases, you can increase the limit (by adding limit=100) and then doing 3 additional requests (offset=100, offset=200 and finally offset=300). Your last request would therefore be to https://musicbrainz.org/ws/2/release?artist=494e8d09-f85b-4543-892f-a5096aed1cd4&fmt=json&inc=release-groups&limit=100&offset=300

(这不是一个保证的结果,但情人节 EP 的偏移量为 100,Say Someth' & Shake It Off 为 200,而没有 You Bootleg 为 300.)

(This is not a guaranteed result, but the Valentines EP appears with an offset of 100, Say Somethin' & Shake It Off with 200 and the Without You Bootleg with 300.)

请注意,JSON Web Service 仍处于测试阶段 - 如果您只是更改fmt=jsonfmt=xml,您将使用稳定的 XML Web 服务.

Please note that the JSON Web Service is still in a beta stage - if you just change fmt=json to fmt=xml, you'll use the stable XML Web Service.

这篇关于musicbrainz api 获取所有发布组和发布日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆