rizzzigit/jikan4.js

Trailers don't include images

Closed this issue · 1 comments

The Jikan API returns the following data for the trailer:

{
  "youtube_id": "LHtdKWJdif4",
  "url": "https://www.youtube.com/watch?v=LHtdKWJdif4",
  "embed_url": "https://www.youtube.com/embed/LHtdKWJdif4?enablejsapi=1&wmode=opaque&autoplay=1",
  "images": {
    "image_url": "https://img.youtube.com/vi/LHtdKWJdif4/default.jpg",
    "small_image_url": "https://img.youtube.com/vi/LHtdKWJdif4/sddefault.jpg",
    "medium_image_url": "https://img.youtube.com/vi/LHtdKWJdif4/mqdefault.jpg",
    "large_image_url": "https://img.youtube.com/vi/LHtdKWJdif4/hqdefault.jpg",
    "maximum_image_url": "https://img.youtube.com/vi/LHtdKWJdif4/maxresdefault.jpg"
  }
}

However, jikan4.js only includes the youtube_id, url, and embed url.

export class YoutubeVideo extends BaseClass {
  public readonly id: string
  public readonly url: URL
  public readonly embedUrl: URL

  public constructor (client: Client, data: any) {
    super(client)

    this.id = data
    this.url = new URL(`https://youtu.be/${this.id}`)
    this.embedUrl = new URL(`https://www.youtube.com/embed/${this.id}`)
  }
}

For my project, I need access to the images. Can we modify the YoutubeVideo class to include these properties?

Hello. Sorry for the late response. The new version that resolves this should be available right now.