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, )