Melon-Shake / API

2 stars 1 forks source link

[차트 정규화] spotify search 사용시 다른 음악 검색결과가 나옴 #110

Closed jungssg closed 1 year ago

jungssg commented 1 year ago

사이트에서 top100 차트의 노래제목, 가수이름으로 spotify search 했을때 다른 음악 결과

검색결과

{
  "tracks": {
    "href": "https://api.spotify.com/v1/search?query=%EC%9D%B4%EB%B8%8C%2C++%ED%94%84%EC%8B%9C%EC%BC%80+%EA%B7%B8%EB%A6%AC%EA%B3%A0+%ED%91%B8%EB%A5%B8+%EC%88%98%EC%97%BC%EC%9D%98+%EC%95%84%EB%82%B4+LE+SSERAFIM+%28%EB%A5%B4%EC%84%B8%EB%9D%BC%ED%95%8C%29&type=track&market=KR&locale=ko-KR%2Cko%3Bq%3D0.9%2Cen-US%3Bq%3D0.8%2Cen%3Bq%3D0.7&offset=0&limit=1",
    "items": [
      {
        "album": {
          "album_type": "single",
          "artists": [
            {
              "external_urls": {
                "spotify": "https://open.spotify.com/artist/5Ecf8RR2UWFAvyeItabffF"
              },
              "href": "https://api.spotify.com/v1/artists/5Ecf8RR2UWFAvyeItabffF",
              "id": "5Ecf8RR2UWFAvyeItabffF",
              "name": "이승철",
              "type": "artist",
              "uri": "spotify:artist:5Ecf8RR2UWFAvyeItabffF"
            }
          ],
          "external_urls": {
            "spotify": "https://open.spotify.com/album/4ybqL6fP7aAL7vPKIOr9Lh"
          },
          "href": "https://api.spotify.com/v1/albums/4ybqL6fP7aAL7vPKIOr9Lh",
          "id": "4ybqL6fP7aAL7vPKIOr9Lh",
          "images": [
            {
              "height": 640,
              "url": "https://i.scdn.co/image/ab67616d0000b2738b0eeb3f897c2fef2cb5a8f0",
              "width": 640
            },
            {
              "height": 300,
              "url": "https://i.scdn.co/image/ab67616d00001e028b0eeb3f897c2fef2cb5a8f0",
              "width": 300
            },
            {
              "height": 64,
              "url": "https://i.scdn.co/image/ab67616d000048518b0eeb3f897c2fef2cb5a8f0",
              "width": 64
            }
          ],
          "is_playable": true,
          "name": "Mutopia",
          "release_date": "2009-05-06",
          "release_date_precision": "day",
          "total_tracks": 2,
          "type": "album",
          "uri": "spotify:album:4ybqL6fP7aAL7vPKIOr9Lh"
        },
        "artists": [
          {
            "external_urls": {
              "spotify": "https://open.spotify.com/artist/5Ecf8RR2UWFAvyeItabffF"
            },
            "href": "https://api.spotify.com/v1/artists/5Ecf8RR2UWFAvyeItabffF",
            "id": "5Ecf8RR2UWFAvyeItabffF",
            "name": "이승철",
            "type": "artist",
            "uri": "spotify:artist:5Ecf8RR2UWFAvyeItabffF"
          }
        ],
        "disc_number": 1,
        "duration_ms": 226266,
        "explicit": false,
        "external_ids": {
          "isrc": "QZEKE1928793"
        },
        "external_urls": {
          "spotify": "https://open.spotify.com/track/5MGZPn7QWGD3DTmPyrpj79"
        },
        "href": "https://api.spotify.com/v1/tracks/5MGZPn7QWGD3DTmPyrpj79",
        "id": "5MGZPn7QWGD3DTmPyrpj79",
        "is_local": false,
        "is_playable": true,
        "name": "그런 사람 또 없습니다",
        "popularity": 43,
        "preview_url": "https://p.scdn.co/mp3-preview/d0ec723227cc11133c84bb9e26e71c19015c1c0b?cid=5ef17a91df0745b4927294d9f2b7e2d9",
        "track_number": 2,
        "type": "track",
        "uri": "spotify:track:5MGZPn7QWGD3DTmPyrpj79"
      }
    ],
    "limit": 1,
    "next": "https://api.spotify.com/v1/search?query=%EC%9D%B4%EB%B8%8C%2C++%ED%94%84%EC%8B%9C%EC%BC%80+%EA%B7%B8%EB%A6%AC%EA%B3%A0+%ED%91%B8%EB%A5%B8+%EC%88%98%EC%97%BC%EC%9D%98+%EC%95%84%EB%82%B4+LE+SSERAFIM+%28%EB%A5%B4%EC%84%B8%EB%9D%BC%ED%95%8C%29&type=track&market=KR&locale=ko-KR%2Cko%3Bq%3D0.9%2Cen-US%3Bq%3D0.8%2Cen%3Bq%3D0.7&offset=1&limit=1",
    "offset": 0,
    "previous": null,
    "total": 800
  }
}

검색에 앨범정보 추가

{ "tracks": { "href": "https://api.spotify.com/v1/search?query=%EC%9D%B4%EB%B8%8C%2C++%ED%94%84%EC%8B%9C%EC%BC%80+%EA%B7%B8%EB%A6%AC%EA%B3%A0+%ED%91%B8%EB%A5%B8+%EC%88%98%EC%97%BC%EC%9D%98+%EC%95%84%EB%82%B4+LE+SSERAFIM+%28%EB%A5%B4%EC%84%B8%EB%9D%BC%ED%95%8C%29+UNFORGIVEN&type=track&market=KR&locale=ko-KR%2Cko%3Bq%3D0.9%2Cen-US%3Bq%3D0.8%2Cen%3Bq%3D0.7&offset=0&limit=1", "items": [ { "album": { "album_type": "album", "artists": [ { "external_urls": { "spotify": "https://open.spotify.com/artist/4SpbR6yFEvexJuaBpgAU5p" }, "href": "https://api.spotify.com/v1/artists/4SpbR6yFEvexJuaBpgAU5p", "id": "4SpbR6yFEvexJuaBpgAU5p", "name": "LE SSERAFIM", "type": "artist", "uri": "spotify:artist:4SpbR6yFEvexJuaBpgAU5p" } ], "external_urls": { "spotify": "https://open.spotify.com/album/4Oz7K9DRwwGMN49i4NbVDT" }, "href": "https://api.spotify.com/v1/albums/4Oz7K9DRwwGMN49i4NbVDT", "id": "4Oz7K9DRwwGMN49i4NbVDT", "images": [ { "height": 640, "url": "https://i.scdn.co/image/ab67616d0000b273d71fd77b89d08bc1bda219c7", "width": 640 }, { "height": 300, "url": "https://i.scdn.co/image/ab67616d00001e02d71fd77b89d08bc1bda219c7", "width": 300 }, { "height": 64, "url": "https://i.scdn.co/image/ab67616d00004851d71fd77b89d08bc1bda219c7", "width": 64 } ], "is_playable": true, "name": "UNFORGIVEN", "release_date": "2023-05-01", "release_date_precision": "day", "total_tracks": 13, "type": "album", "uri": "spotify:album:4Oz7K9DRwwGMN49i4NbVDT" }, "artists": [ { "external_urls": { "spotify": "https://open.spotify.com/artist/4SpbR6yFEvexJuaBpgAU5p" }, "href": "https://api.spotify.com/v1/artists/4SpbR6yFEvexJuaBpgAU5p", "id": "4SpbR6yFEvexJuaBpgAU5p", "name": "LE SSERAFIM", "type": "artist", "uri": "spotify:artist:4SpbR6yFEvexJuaBpgAU5p" }, { "external_urls": { "spotify": "https://open.spotify.com/artist/3yDIp0kaq9EFKe07X1X2rz" }, "href": "https://api.spotify.com/v1/artists/3yDIp0kaq9EFKe07X1X2rz", "id": "3yDIp0kaq9EFKe07X1X2rz", "name": "Nile Rodgers", "type": "artist", "uri": "spotify:artist:3yDIp0kaq9EFKe07X1X2rz" } ], "disc_number": 1, "duration_ms": 182148, "explicit": false, "external_ids": { "isrc": "USA2P2310663" }, "external_urls": { "spotify": "https://open.spotify.com/track/51vRumtqbkNW9wrKfESwfu" }, "href": "https://api.spotify.com/v1/tracks/51vRumtqbkNW9wrKfESwfu", "id": "51vRumtqbkNW9wrKfESwfu", "is_local": false, "is_playable": true, "name": "UNFORGIVEN (feat. Nile Rodgers)", "popularity": 84, "preview_url": "https://p.scdn.co/mp3-preview/ba72474a4c4c3a63f8c6d00c561ad40be6e1e7c7?cid=5ef17a91df0745b4927294d9f2b7e2d9", "track_number": 8, "type": "track", "uri": "spotify:track:51vRumtqbkNW9wrKfESwfu" } ], "limit": 1, "next": "https://api.spotify.com/v1/search?query=%EC%9D%B4%EB%B8%8C%2C++%ED%94%84%EC%8B%9C%EC%BC%80+%EA%B7%B8%EB%A6%AC%EA%B3%A0+%ED%91%B8%EB%A5%B8+%EC%88%98%EC%97%BC%EC%9D%98+%EC%95%84%EB%82%B4+LE+SSERAFIM+%28%EB%A5%B4%EC%84%B8%EB%9D%BC%ED%95%8C%29+UNFORGIVEN&type=track&market=KR&locale=ko-KR%2Cko%3Bq%3D0.9%2Cen-US%3Bq%3D0.8%2Cen%3Bq%3D0.7&offset=1&limit=1", "offset": 0, "previous": null, "total": 800 } }

jungssg commented 1 year ago

spotify 에서 한글제목이 등록되어있지 않고 국내차트에서는 한글제목이 있을경우 예외처리하고 나중에 라우터에 추가해서 사용하는방안 고려