emresenyuva / youtube-music-api

Node.js Unoffical Youtube Music API
MIT License
116 stars 47 forks source link

Searching for a track returns artist in album field #22

Open b0wter opened 2 years ago

b0wter commented 2 years ago

When I am searching for a song like this:

const results = await this.api.search(trackId, "song").then((r: any) => r.content);

the first result looks like this:

  type: 'song',
  videoId: 'tOqmrNvfoHk',
  playlistId: 'RDAMVMtOqmrNvfoHk',
  name: 'Easy Lover',
  artist: {
    name: 'Philip Bailey, Phil Collins',
    browseId: 'UCbOnsnfAPyF0DDw3YpsNudg'
  },
  album: {
    name: 'Philip Bailey, Phil Collins',
    browseId: 'UCbOnsnfAPyF0DDw3YpsNudg'
  },
  duration: 305000,
  thumbnails: [
    {
      url: 'https://lh3.googleusercontent.com/wTXvYmIuXs6giffNevgamlwI9o5q7MQMforfk0igktDkXPSc__V1Hnbc72UKdmkBodzaLua8OWfsvg=w60-h60-l90-rj',
      width: 60,
      height: 60
    },
    {
      url: 'https://lh3.googleusercontent.com/wTXvYmIuXs6giffNevgamlwI9o5q7MQMforfk0igktDkXPSc__V1Hnbc72UKdmkBodzaLua8OWfsvg=w120-h120-l90-rj',
      width: 120,
      height: 120
    }
  ],
  params: 'wAEB'
}

As you can see album.name is actually set to artist.name. The same is true for browseId.