Skip to content

Commit

Permalink
♻️ better url creation
Browse files Browse the repository at this point in the history
  • Loading branch information
CXwudi committed Jan 3, 2024
1 parent fd355d5 commit a07166b
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ class BilibiliThumbnailFinder(
override suspend fun findThumbnail(pv: PVInfo): ThumbnailInfo {
val bvid: String? = tryGetBvid(pv.extendedMetadata)
val rsp: HttpResponse = withContext(MyDispatchers.ioDispatcher) {
if (bvid == null) {
client.get("https://api.bilibili.com/x/web-interface/view?aid=${pv.id}")
} else {
client.get("https://api.bilibili.com/x/web-interface/view?bvid=$bvid")
client.get("https://api.bilibili.com/x/web-interface/view") {
url {
if (bvid != null) {
parameters.append("bvid", bvid)
} else {
parameters.append("aid", pv.id)
}
}
}
}

Expand Down

0 comments on commit a07166b

Please sign in to comment.