v1.0.2: TvmonScraper 소스 적용 (카테고리 정렬 파라미터 제거)

This commit is contained in:
tvmon-dev
2026-04-16 18:08:34 +09:00
parent 55c45cd399
commit 626517c9ef
3 changed files with 19 additions and 21 deletions

View File

@@ -13,8 +13,8 @@ android {
applicationId "com.example.tvmon"
minSdk 28
targetSdk 34
versionCode 2
versionName "1.0.1"
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

View File

@@ -142,19 +142,17 @@ private fun extractSeriesUrl(url: String): String {
result
}
suspend fun getCategory(categoryKey: String, page: Int = 1): CategoryResult = withContext(Dispatchers.IO) {
val catInfo = CATEGORIES[categoryKey] ?: return@withContext CategoryResult(
success = false,
category = "Unknown",
items = emptyList(),
page = page,
pagination = Pagination(1, 1)
)
suspend fun getCategory(categoryKey: String, page: Int = 1): CategoryResult = withContext(Dispatchers.IO) {
val catInfo = CATEGORIES[categoryKey] ?: return@withContext CategoryResult(
success = false,
category = "Unknown",
items = emptyList(),
page = page,
pagination = Pagination(1, 1)
)
// Sort by wr_datetime (latest first) - same as website default sorting
val sortParam = "sst=wr_datetime&sod=desc"
val url = if (page == 1) "$BASE_URL${catInfo.path}?$sortParam" else "$BASE_URL${catInfo.path}?$sortParam&page=$page"
val html = get(url) ?: return@withContext CategoryResult(
val url = if (page == 1) "$BASE_URL${catInfo.path}" else "$BASE_URL${catInfo.path}?page=$page"
val html = get(url) ?: return@withContext CategoryResult(
success = false,
category = catInfo.name,
items = emptyList(),
@@ -390,7 +388,7 @@ suspend fun getCategory(categoryKey: String, page: Int = 1): CategoryResult = wi
val patterns = listOf(
"출연[^:]*[:\\s]*(.+?)(?:\\n|$)",
"[^:]*[:\\s]*(.+?)(?:\\n|$)",
"[^:]*[:\\s]*(.+?)(?:\\n|$)",
"배우[^:]*[:\\s]*(.+?)(?:\\n|$)",
"Cast[^:]*[:\\s]*(.+?)(?:\\n|$)"
)
@@ -615,4 +613,4 @@ val allLinks = doc.select("a.poster[href*='/movie/'], a.poster[href*='/drama/'],
}
return "unknown"
}
}
}