Files
FancyBot/src/main/kotlin/cn/rtast/fancybot/entity/pixiv/Ranking.kt
T

33 lines
802 B
Kotlin
Raw Normal View History

2024-09-05 18:29:54 +08:00
/*
* Copyright © 2024 RTAkland
* Author: RTAkland
* Date: 2024/9/5
*/
package cn.rtast.fancybot.entity.pixiv
2024-09-27 23:31:01 +08:00
import com.google.gson.annotations.SerializedName
2024-09-05 18:29:54 +08:00
data class Ranking(
val contents: List<Content>
) {
data class Content(
val title: String,
val tags: List<String>,
2024-09-27 23:31:01 +08:00
val url: String,
@SerializedName("user_name")
val userName: String,
@SerializedName("user_id")
val userId: Long,
@SerializedName("illust_id")
val illustId: Long,
val date: String,
2024-09-05 18:29:54 +08:00
) {
fun getOriginUrl(): String {
2024-09-27 23:31:01 +08:00
return url.replace("https://i.pximg.net", "https://i.pixiv.re")
2024-09-05 18:29:54 +08:00
.replace("/c/240x480/img-master/", "/img-original/")
.replace("_master1200", "")
}
}
}