chore: format code

This commit is contained in:
2024-10-13 11:58:31 +08:00
parent a78a365ebd
commit f0e6f31faf
1 file changed
+12 -6
@@ -28,10 +28,7 @@ import java.awt.image.BufferedImage
object DouyinVideoParseCommand { object DouyinVideoParseCommand {
private val tempHttpClient = OkHttpClient.Builder() private val tempHttpClient = OkHttpClient.Builder().followRedirects(true).followSslRedirects(true).build()
.followRedirects(true)
.followSslRedirects(true)
.build()
private val shortLinkRegex = Regex("https://v\\.douyin\\.com/[a-zA-Z0-9]+/") private val shortLinkRegex = Regex("https://v\\.douyin\\.com/[a-zA-Z0-9]+/")
private val singleVideoRegex = Regex("https://www\\.douyin\\.com/video/([0-9]+)") private val singleVideoRegex = Regex("https://www\\.douyin\\.com/video/([0-9]+)")
private val douyinApiUrl = "https://douyin.wtf/api/douyin/web/fetch_one_video".proxy private val douyinApiUrl = "https://douyin.wtf/api/douyin/web/fetch_one_video".proxy
@@ -46,7 +43,16 @@ object DouyinVideoParseCommand {
g2d.color = Color(245, 245, 245) g2d.color = Color(245, 245, 245)
g2d.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT) g2d.fillRect(0, 0, IMAGE_WIDTH, IMAGE_HEIGHT)
g2d.color = Color(230, 230, 230) g2d.color = Color(230, 230, 230)
g2d.fill(RoundRectangle2D.Float(20f, 20f, (IMAGE_WIDTH - 40).toFloat(), (IMAGE_HEIGHT - 40).toFloat(), 50f, 50f)) g2d.fill(
RoundRectangle2D.Float(
20f,
20f,
(IMAGE_WIDTH - 40).toFloat(),
(IMAGE_HEIGHT - 40).toFloat(),
50f,
50f
)
)
g2d.color = Color.BLACK g2d.color = Color.BLACK
g2d.font = Font("Serif", Font.BOLD, 48) g2d.font = Font("Serif", Font.BOLD, 48)
g2d.drawString(video.data.awemeDetail.author.nickname, 60, 100) g2d.drawString(video.data.awemeDetail.author.nickname, 60, 100)