fix: fix cover
This commit is contained in:
2 files changed
+3
-5
No files matched your search
@@ -44,7 +44,7 @@ object YoutubeVideoParseCommand {
|
|||||||
g2d.font = Font("Serif", Font.PLAIN, 18)
|
g2d.font = Font("Serif", Font.PLAIN, 18)
|
||||||
val channelTitle = videoInfo.items.first().snippet.channelTitle
|
val channelTitle = videoInfo.items.first().snippet.channelTitle
|
||||||
g2d.drawString(channelTitle, 20, 70)
|
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()
|
.proxy.toURL().readBytes().toBufferedImage()
|
||||||
val scaledWidth = 300
|
val scaledWidth = 300
|
||||||
val scaledHeight = (thumbnailImage.height * (scaledWidth / thumbnailImage.width.toDouble())).toInt()
|
val scaledHeight = (thumbnailImage.height * (scaledWidth / thumbnailImage.width.toDouble())).toInt()
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
package cn.rtast.fancybot.entity.yt
|
package cn.rtast.fancybot.entity.yt
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName
|
|
||||||
|
|
||||||
|
|
||||||
data class YoutubeVideoResponse(
|
data class YoutubeVideoResponse(
|
||||||
@@ -25,11 +24,10 @@ data class YoutubeVideoResponse(
|
|||||||
)
|
)
|
||||||
|
|
||||||
data class Thumbnails(
|
data class Thumbnails(
|
||||||
@SerializedName("maxres")
|
val standard: Standard
|
||||||
val maxRes: MaxRes
|
|
||||||
)
|
)
|
||||||
|
|
||||||
data class MaxRes(
|
data class Standard(
|
||||||
val url: String,
|
val url: String,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user