From a59a5447927cbb1328a44ac626354c5232545196 Mon Sep 17 00:00:00 2001 From: RTAkland Date: Tue, 15 Oct 2024 15:47:48 +0800 Subject: [PATCH] fix: fix cover --- .../fancybot/commands/parse/YoutubeVideoParseCommand.kt | 2 +- .../cn/rtast/fancybot/entity/yt/YoutubeVideoResponse.kt | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/cn/rtast/fancybot/commands/parse/YoutubeVideoParseCommand.kt b/src/main/kotlin/cn/rtast/fancybot/commands/parse/YoutubeVideoParseCommand.kt index f837e65..6bd9736 100644 --- a/src/main/kotlin/cn/rtast/fancybot/commands/parse/YoutubeVideoParseCommand.kt +++ b/src/main/kotlin/cn/rtast/fancybot/commands/parse/YoutubeVideoParseCommand.kt @@ -44,7 +44,7 @@ object YoutubeVideoParseCommand { g2d.font = Font("Serif", Font.PLAIN, 18) val channelTitle = videoInfo.items.first().snippet.channelTitle g2d.drawString(channelTitle, 20, 70) - val thumbnailImage = videoInfo.items.first().snippet.thumbnails.maxRes.url + val thumbnailImage = videoInfo.items.first().snippet.thumbnails.standard.url .proxy.toURL().readBytes().toBufferedImage() val scaledWidth = 300 val scaledHeight = (thumbnailImage.height * (scaledWidth / thumbnailImage.width.toDouble())).toInt() diff --git a/src/main/kotlin/cn/rtast/fancybot/entity/yt/YoutubeVideoResponse.kt b/src/main/kotlin/cn/rtast/fancybot/entity/yt/YoutubeVideoResponse.kt index 8ef8de9..e399217 100644 --- a/src/main/kotlin/cn/rtast/fancybot/entity/yt/YoutubeVideoResponse.kt +++ b/src/main/kotlin/cn/rtast/fancybot/entity/yt/YoutubeVideoResponse.kt @@ -7,7 +7,6 @@ package cn.rtast.fancybot.entity.yt -import com.google.gson.annotations.SerializedName data class YoutubeVideoResponse( @@ -25,11 +24,10 @@ data class YoutubeVideoResponse( ) data class Thumbnails( - @SerializedName("maxres") - val maxRes: MaxRes + val standard: Standard ) - data class MaxRes( + data class Standard( val url: String, )