使用Spotify的API获取封面图案 [英] Retrieve cover artwork using Spotify API

查看:1401
本文介绍了使用Spotify的API获取封面图案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前还没有方法来检索使用Spotify的网络API的封面图案。是否有计划来实现这些或任何变通办法?

There is currently no way to retrieve the cover artwork using Spotify's Web API. Are there plans to implement these or any workarounds?

推荐答案

今天的Spotify发布了一个新的网页API

June 17th 2014:

Today Spotify released a new Web Api.

现在可以方便地检索封面图案,如 包括<$阵列所有端点C $ C>图片每项目

It is now easy to retrieve cover artwork, as all endpoints includes an array of images for every item.

搜索例如:结果
卷曲-X GEThttps://api.spotify.com/v1/search?q=tania%20bowra&type=artist

{
  "artists" : {
...
    "items" : [ {
...
      "images" : [ {
        "height" : 640,
        "url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718",
        "width" : 640
      }, {
        "height" : 300,
        "url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55",
        "width" : 300
      }, {
        "height" : 64,
        "url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4",
        "width" : 64
...
    } ],
...
  }
}

老答案:


您可以通过调用Spotify的服务透过oEmbed得到的URL封面:

Old Answer:


You can get the URL to the cover art by calling Spotify's oEmbed service:

<一个href=\"https://embed.spotify.com/oembed/?url=spotify%3atrack:6bc5scNUVa3h76T9nvpGIH\">https://embed.spotify.com/oembed/?url=spotify:track:6bc5scNUVa3h76T9nvpGIH

<一href=\"https://embed.spotify.com/oembed/?url=spotify%3aalbum:5NCz8TTIiax2h1XTnImAQ2\">https://embed.spotify.com/oembed/?url=spotify:album:5NCz8TTIiax2h1XTnImAQ2

<一href=\"https://embed.spotify.com/oembed/?url=spotify%3aartist:7ae4vgLLhir2MCjyhgbGOQ\">https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ

随着JSONP:结果
<一href=\"https://embed.spotify.com/oembed/?url=spotify%3aartist:7ae4vgLLhir2MCjyhgbGOQ&callback=callme\">https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ&callback=callme

http://open.spotify.com/ 的URL以及工作:

<一个href=\"https://embed.spotify.com/oembed/?url=http://open.spotify.com/track/6bc5scNUVa3h76T9nvpGIH\">https://embed.spotify.com/oembed/?url=http://open.spotify.com/track/6bc5scNUVa3h76T9nvpGIH

{
    "provider_url": "https:\/\/www.spotify.com",
    "version": "1.0",
    "thumbnail_width": 300,
    "height": 380,
    "thumbnail_height": 300,
    "title": "Gusgus - Within You",
    "width": 300,
    "thumbnail_url": "https:\/\/d3rt1990lpmkn.cloudfront.net\/cover\/f15552e72e1fcf02484d94553a7e7cd98049361a",
    "provider_name": "Spotify",
    "type": "rich",
    "html": "<iframe src=\"https:\/\/embed.spotify.com\/?uri=spotify:track:6bc5scNUVa3h76T9nvpGIH\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"><\/iframe>"
}

注意 thumbnail_url :结果
<一href=\"https://d3rt1990lpmkn.cloudfront.net/cover/f15552e72e1fcf02484d94553a7e7cd98049361a\">https://d3rt1990lpmkn.cloudfront.net/cover/f15552e72e1fcf02484d94553a7e7cd98049361a

/套/ 重新presents缩略图的大小。结果
现有尺寸: 60 85 120 300 640

/cover/ represents the size of the thumbnail.
Available sizes: 60, 85, 120, 300, and 640.

例如:<一href=\"https://d3rt1990lpmkn.cloudfront.net/640/f15552e72e1fcf02484d94553a7e7cd98049361a\">https://d3rt1990lpmkn.cloudfront.net/640/f15552e72e1fcf02484d94553a7e7cd98049361a

这篇关于使用Spotify的API获取封面图案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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