获取专辑的发行日期last.fm api

问题描述 投票:0回答:1

我需要获取歌曲的发行日期。

在last.fm API中,如文档中所述,足以向服务器发出HTTP请求,它将使用包含字段“”的XML(或JSON)进行回复(如“示例响应”中的该网站)。

问题是,如果我在文档中使用相同的请求进行调用,则除了我需要的字段外,答复是相同的。

是否可能以其他方式获得此信息?

示例:

  • 示例响应在网站上的部分:

    <album>
      <name>Believe</name>
      <artist>Cher</artist>
      <id>2026126</id>
      <mbid>61bf0388-b8a9-48f4-81d1-7eb02706dfb0</mbid>
      <url>http://www.last.fm/music/Cher/Believe</url>
      <releasedate>6 Apr 1999, 00:00</releasedate> //i need this
      <image size="small">...</image>
      <image size="medium">...</image>
      <image size="large">...</image>
      <listeners>47602</listeners>
      <playcount>212991</playcount>
      <toptags>
        <tag>
          <name>pop</name>
          <url>http://www.last.fm/tag/pop</url>
        </tag>
        ...
      </toptags>
      <tracks>
        <track rank="1">
          <name>Believe</name>
          <duration>239</duration>
          <mbid/>
          <url>http://www.last.fm/music/Cher/_/Believe</url>
          <streamable fulltrack="0">1</streamable>
          <artist>
            <name>Cher</name>
            <mbid>bfcc6d75-a6a5-4bc6-8282-47aec8531818</mbid>
            <url>http://www.last.fm/music/Cher</url>
          </artist>
        </track>
        ...
      </tracks>
    </album>

  • 我的回复

    <album>
    <name>Believe</name>
    <artist>Cher</artist>
    <mbid>63b3a8ca-26f2-4e2b-b867-647a6ec2bebd</mbid>
    <url>https://www.last.fm/music/Cher/Believe</url>
    <image size="small">
    https://lastfm.freetls.fastly.net/i/u/34s/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <image size="medium">
    https://lastfm.freetls.fastly.net/i/u/64s/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <image size="large">
    https://lastfm.freetls.fastly.net/i/u/174s/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <image size="extralarge">
    https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <image size="mega">
    https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <image size="">
    https://lastfm.freetls.fastly.net/i/u/300x300/3b54885952161aaea4ce2965b2db1638.png
    </image>
    <listeners>405536</listeners>
    <playcount>2644726</playcount>
    <tracks>
    ...
    <tags>...</tags>
    <wiki>...</wiki>
    </album>
    </lfm>

请求为http://ws.audioscrobbler.com/2.0/?method=album.getinfo&api_key=MY_API_KEY&artist=Cher&album=Believe

该信息所在的页面是:https://www.last.fm/api/show/album.getInfo

非常感谢!

last.fm
1个回答
0
投票

在Last.fm API文档中与实际响应绝对不一致。

可能提供此类信息的唯一其他地方是artist.getTopAlbums,但发布日期也不可用。

因此,要回答您的问题,不,无法通过API获取专辑的发行日期。如果您确实希望获得此信息,最好的选择是通过网络抓取从html页面本身中提取信息,并且在这种情况下不要依赖API。

© www.soinside.com 2019 - 2024. All rights reserved.