Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
fix account link.
Browse files Browse the repository at this point in the history
  • Loading branch information
WhichWho committed Jun 19, 2022
1 parent 0feafed commit 6708506
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 13 additions & 3 deletions src/main/kotlin/loli/ball/kemono/Global.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@ import java.util.*
const val BASE_URL = "https://beta.kemono.party"

//Mon, 02 Aug 2021 01:35:16 GMT
val GTMDateParser = SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH)
val GTMDateParser = object : SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss 'GMT'", Locale.ENGLISH) {
override fun parse(source: String?): Date {
if (source.isNullOrBlank()) return Date(0L)
return super.parse(source)
}
}

//2022-01-26 22:10:13
val dateParser = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH)
val dateParser = object : SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.ENGLISH) {
override fun parse(source: String?): Date {
if (source.isNullOrBlank()) return Date(0L)
return super.parse(source)
}
}

val rangeRegexp = """Showing (\d+) - (\d+) of (\d+)""".toRegex()

val pictureCountRegexp = """(\d+).*""".toRegex()

class AccountException(override val message: String?): Exception(message)
class AccountException(override val message: String?) : Exception(message)
6 changes: 4 additions & 2 deletions src/main/kotlin/loli/ball/kemono/network/AccountNetwork.kt
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ object AccountNetwork {

fun favoriteArtistsJson(): String {
val request = Request.Builder()
.url("$BASE_URL/api/favorites?type=artist")
// .url("$BASE_URL/api/favorites?type=artist")
.url("$BASE_URL/api/v1/account/favorites?type=artist")
.addHeader("cookie", account!!.cookie)
.get()
.build()
Expand All @@ -142,7 +143,8 @@ object AccountNetwork {

fun favoritePostsJson(): String {
val request = Request.Builder()
.url("$BASE_URL/api/favorites?type=post")
// .url("$BASE_URL/api/favorites?type=post")
.url("$BASE_URL/api/v1/account/favorites?type=post")
.addHeader("cookie", account!!.cookie)
.get()
.build()
Expand Down

0 comments on commit 6708506

Please sign in to comment.