fix: fix bv parse
This commit is contained in:
1 file changed
+3
-3
@@ -188,6 +188,8 @@ object BVParseCommand {
|
|||||||
} else if (shortUrlRegex.containsMatchIn(message.rawMessage)) {
|
} else if (shortUrlRegex.containsMatchIn(message.rawMessage)) {
|
||||||
val shortUrl = shortUrlRegex.find(message.rawMessage)!!.value
|
val shortUrl = shortUrlRegex.find(message.rawMessage)!!.value
|
||||||
getShortUrlBVID(shortUrl)
|
getShortUrlBVID(shortUrl)
|
||||||
|
} else if (bvRegex.containsMatchIn(message.rawMessage)) {
|
||||||
|
bvRegex.find(message.rawMessage)!!.value
|
||||||
} else if (message.message.find { it.type == ArrayMessageType.json } != null) {
|
} else if (message.message.find { it.type == ArrayMessageType.json } != null) {
|
||||||
val card = message.message.find { it.type == ArrayMessageType.json }!!
|
val card = message.message.find { it.type == ArrayMessageType.json }!!
|
||||||
.data.data!!.toString().fromJson<CardShare>()
|
.data.data!!.toString().fromJson<CardShare>()
|
||||||
@@ -200,9 +202,7 @@ object BVParseCommand {
|
|||||||
}
|
}
|
||||||
getShortUrlBVID(shortUrl)
|
getShortUrlBVID(shortUrl)
|
||||||
} else {
|
} else {
|
||||||
message.rawMessage.split("?").first()
|
return
|
||||||
.split("/")
|
|
||||||
.last { it.isNotEmpty() && it.isNotBlank() }
|
|
||||||
}
|
}
|
||||||
val videoInfo = this.getVideoStat(bvid)
|
val videoInfo = this.getVideoStat(bvid)
|
||||||
val viewCount = this.getViewCount(bvid, videoInfo.data.cid)
|
val viewCount = this.getViewCount(bvid, videoInfo.data.cid)
|
||||||
|
|||||||
Reference in New Issue
Block a user